Class: Slippers::TemplateNode

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/engine/slippers_nodes.rb

Instance Method Summary collapse

Instance Method Details

#apply_attribute_to_subtemplate(item, template_group) ⇒ Object



59
60
61
62
63
64
# File 'lib/engine/slippers_nodes.rb', line 59

def apply_attribute_to_subtemplate(item, template_group)
  return '' unless template_group
  subtemplate = template_group.find(template_path.to_s)
  return '' unless (subtemplate && subtemplate.respond_to?('render')) 
  subtemplate.render(item)
end

#eval(object_to_render, template_group) ⇒ Object



55
56
57
# File 'lib/engine/slippers_nodes.rb', line 55

def eval(object_to_render, template_group)
  apply_attribute_to_subtemplate(object_to_render, template_group)
end