Class: Rucoa::Nodes::IfNode

Inherits:
Base
  • Object
show all
Includes:
Rucoa::NodeConcerns::Modifier
Defined in:
lib/rucoa/nodes/if_node.rb

Instance Method Summary collapse

Methods included from Rucoa::NodeConcerns::Modifier

#modifier?

Methods inherited from Base

#ancestors, #child_nodes, #descendant_nodes, #each_ancestor, #each_child_node, #each_descendant_node, #include_position?, #initialize, #module_nesting, #namespace, #next_sibling_nodes, #parent, #parent=, #previous_sibling_nodes, #updated

Constructor Details

This class inherits a constructor from Rucoa::Nodes::Base

Instance Method Details

#branch_elseRucoa::Nodes::Base?

Returns:



9
10
11
# File 'lib/rucoa/nodes/if_node.rb', line 9

def branch_else
  children[2]
end

#branch_ifRucoa::Nodes::Base?

Returns:



14
15
16
# File 'lib/rucoa/nodes/if_node.rb', line 14

def branch_if
  children[1]
end

#conditionRucoa::Nodes::Base

Returns:



19
20
21
# File 'lib/rucoa/nodes/if_node.rb', line 19

def condition
  children[0]
end

#elsifRucoa::Nodes::IfNode?

Returns:



24
25
26
# File 'lib/rucoa/nodes/if_node.rb', line 24

def elsif
  branch_else if branch_else.is_a?(Nodes::IfNode)
end

#elsif?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rucoa/nodes/if_node.rb', line 29

def elsif?
  parent.is_a?(Nodes::IfNode) && equal?(parent.elsif)
end