Class: Slippers::ConditionalTemplateNode

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

Instance Method Summary collapse

Instance Method Details

#eval(object_to_render, template_group) ⇒ Object



104
105
106
107
108
109
110
111
# File 'lib/engine/slippers_nodes.rb', line 104

def eval(object_to_render, template_group)
  attribute = if_clause.value_of(object_to_render, template_group)
  if (attribute && attribute != default_string(template_group)) then
    if_expression.eval(object_to_render, template_group)
  else
    if else_clause.elements then else_clause.else_expression.eval(object_to_render, template_group) else default_string(template_group) end
  end
end