Class: Rubasteme::AST::CondNode

Inherits:
ListNode show all
Defined in:
lib/rubasteme/ast/branch_node.rb

Instance Method Summary collapse

Methods inherited from ListNode

#elements, #empty?, #first, #rest

Methods inherited from BranchNode

#<<, #[], #[]=, #each, #size, #to_a

Methods inherited from Node

#to_a, #to_s, #type

Constructor Details

#initialize(_ = nil) ⇒ CondNode

Returns a new instance of CondNode.



293
294
295
# File 'lib/rubasteme/ast/branch_node.rb', line 293

def initialize(_ = nil)
  super(0, _)
end

Instance Method Details

#add_clause(node) ⇒ Object



301
302
303
# File 'lib/rubasteme/ast/branch_node.rb', line 301

def add_clause(node)
  @nodes << node
end

#cond_clausesObject



297
298
299
# File 'lib/rubasteme/ast/branch_node.rb', line 297

def cond_clauses
  @nodes[0..-1]
end