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



65
66
67
68
69
70
# File 'lib/engine/slippers_nodes.rb', line 65

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

#eval(object_to_render, template_group) ⇒ Object



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

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