Class: Rubasteme::AST::CaseClauseNode

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

Instance Method Summary collapse

Methods inherited from HoldingSequenceBaseNode

#sequence, #sequence=

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) ⇒ CaseClauseNode

Returns a new instance of CaseClauseNode.



387
388
389
390
# File 'lib/rubasteme/ast/branch_node.rb', line 387

def initialize(_ = nil)
  # @nodes = [<data>, <sequence>]
  super(2, 1, _)
end

Instance Method Details

#dataObject



392
393
394
# File 'lib/rubasteme/ast/branch_node.rb', line 392

def data
  @nodes[0]
end

#data=(node) ⇒ Object



396
397
398
# File 'lib/rubasteme/ast/branch_node.rb', line 396

def data=(node)
  @nodes[0] = node
end