Class: Markaby::Template

Inherits:
Object show all
Defined in:
lib/gems/markaby-0.5/lib/markaby/template.rb

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ Template

Returns a new instance of Template.



3
4
5
# File 'lib/gems/markaby-0.5/lib/markaby/template.rb', line 3

def initialize(template)
  @template = template      
end

Instance Method Details

#render(*args) ⇒ Object



6
7
8
9
10
# File 'lib/gems/markaby-0.5/lib/markaby/template.rb', line 6

def render(*args)
  output = Builder.new(*args)
  output.instance_eval @template
  return output.to_s
end