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
225 226 227 228 229 |
# File 'lib/daedalus/dependency_grapher.rb', line 225 def initialize(expression, parser) super parser @value = nil @expression = expression.strip end |
Instance Method Details
#execute(defines, node) ⇒ Object
231 232 233 234 235 236 237 238 239 |
# File 'lib/daedalus/dependency_grapher.rb', line 231 def execute(defines, node) @value = ExpressionEvaluator.new(@expression).evaluate defines if @value execute_body(defines, node) elsif @else @else.execute(defines, node) end end |