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.
265 266 267 268 269 |
# File 'lib/daedalus/dependency_grapher.rb', line 265 def initialize(expression, parser) super parser @value = nil @expression = expression.strip end |
Instance Method Details
#execute(defines, node) ⇒ Object
271 272 273 274 275 276 277 278 279 |
# File 'lib/daedalus/dependency_grapher.rb', line 271 def execute(defines, node) @value = ExpressionEvaluator.new(@expression).evaluate defines if @value execute_body(defines, node) elsif @else @else.execute(defines, node) end end |