Class: Renshi::AttributeExpressions::If
- Inherits:
-
Object
- Object
- Renshi::AttributeExpressions::If
- Defined in:
- lib/renshi/attribute_expressions/if.rb
Instance Method Summary collapse
Instance Method Details
#evaluate(expression, node) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/renshi/attribute_expressions/if.rb', line 4 def evaluate(expression, node) node.open_clause("if (#{expression})") sibling = node.next_real if sibling sibling_commands = sibling.commands if sibling_commands.first expression = sibling_commands.first[0][2..-1] if expression == "else" or expression == "elsif" return end end end node.close_clause("end") end |