Class: Daedalus::DependencyGrapher::If
- Includes:
- Conditional, Container
- Defined in:
- lib/daedalus/dependency_grapher.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Container
Instance Method Summary collapse
- #execute(defines, node) ⇒ Object
-
#initialize(expression, parser) ⇒ If
constructor
A new instance of If.
Methods included from Conditional
Methods included from Container
Methods inherited from Node
Constructor Details
#initialize(expression, parser) ⇒ If
Returns a new instance of If.
273 274 275 276 277 |
# File 'lib/daedalus/dependency_grapher.rb', line 273 def initialize(expression, parser) super parser @value = nil @expression = expression.strip end |
Instance Method Details
#execute(defines, node) ⇒ Object
279 280 281 282 283 284 285 286 287 |
# File 'lib/daedalus/dependency_grapher.rb', line 279 def execute(defines, node) @value = ExpressionEvaluator.new(@expression).evaluate defines if @value execute_body(defines, node) elsif @else @else.execute(defines, node) end end |