Inversion::
TemplateTiltAdditions
module
Also add each
to Inversion::Template
so they can be returned from actions directly, too.
TODO: Factor the common parts of this out in Inversion::Template
so there’s no duplication.
def each
self.log.info "rendering template 0x%08x (Sinatra-style)" % [ self.object_id/2 ]
state = Inversion::RenderState.new( nil, self.attributes, self.options )
self.walk_tree {|node| node.before_rendering(state) }
self.log.debug " rendering node tree: %p" % [ @node_tree ]
self.walk_tree {|node| state << node }
self.walk_tree {|node| node.after_rendering(state) }
self.log.info " done rendering template 0x%08x" % [ self.object_id/2 ]
return state.destination.each do |node|
yield( node.to_s )
end
end