Class: Mybot::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/mybot/template.rb

Instance Method Summary collapse

Constructor Details

#initialize(tpl) ⇒ Template

Returns a new instance of Template.



6
7
8
# File 'lib/mybot/template.rb', line 6

def initialize(tpl)
  @tpl = tpl
end

Instance Method Details

#render(params = {}) ⇒ Object



10
11
12
# File 'lib/mybot/template.rb', line 10

def render(params = {})
  ERB.new(@tpl).result(OpenStruct.new(params).instance_eval { binding })
end