Class: Daedalus::DependencyGrapher::IfNotDefined

Inherits:
Node
  • Object
show all
Includes:
Conditional, Container
Defined in:
lib/daedalus/dependency_grapher.rb

Instance Attribute Summary

Attributes included from Container

#body

Instance Method Summary collapse

Methods included from Conditional

#add_else

Methods included from Container

#close, #execute_body

Methods inherited from Node

#add_else, #close

Constructor Details

#initialize(macro, parser) ⇒ IfNotDefined

Returns a new instance of IfNotDefined.



208
209
210
211
# File 'lib/daedalus/dependency_grapher.rb', line 208

def initialize(macro, parser)
  super parser
  @macro = macro.strip
end

Instance Method Details

#execute(defines, node) ⇒ Object



213
214
215
216
217
218
219
# File 'lib/daedalus/dependency_grapher.rb', line 213

def execute(defines, node)
  if !defines.key? @macro
    execute_body defines, node
  elsif @else
    @else.execute(defines, node)
  end
end