Class: Ruty::Template
- Inherits:
-
Object
- Object
- Ruty::Template
- Defined in:
- lib/ruty.rb
Overview
template class
Instance Method Summary collapse
-
#initialize(source) ⇒ Template
constructor
load a template from a sourcecode or nodelist.
-
#render(namespace) ⇒ Object
render the template.
Constructor Details
Instance Method Details
#render(namespace) ⇒ Object
render the template. Pass it a hash or hashlike object (must support [] and has_key?) which is used as data storage for the root namespace
437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/ruty.rb', line 437 def render namespace context = Context.new(namespace) context.push( :ruty => RUTY_CONTEXT, :nil => nil, :true => true, :false => false ) result = '' @nodelist.render_node(context, result) result end |