instiki/vendor/plugins/erubis/test/data/users-guide/example6.rb

13 lines
271 B
Ruby
Raw Normal View History

class MyData
attr_accessor :val, :list
end
## any object can be a context object
mydata = MyData.new
mydata.val = 'Erubis Example'
mydata.list = ['aaa', 'bbb', 'ccc']
require 'erubis'
eruby = Erubis::Eruby.new(File.read('example5.eruby'))
puts eruby.evaluate(mydata)