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.



248
249
250
251
# File 'lib/daedalus/dependency_grapher.rb', line 248

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

Instance Method Details

#execute(defines, node) ⇒ Object



253
254
255
256
257
258
259
# File 'lib/daedalus/dependency_grapher.rb', line 253

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