Class: Rubasteme::AST::IterationSpecNode

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

Returns a new instance of IterationSpecNode.



627
628
629
630
631
# File 'lib/rubasteme/ast/branch_node.rb', line 627

def initialize(_ = nil)
  # 1. @nodes = [<identifier>, <init>, <step>]
  # 2. @nodes = [<identifier>, <init>]
  super(2, _)
end

Instance Method Details

#identifierObject



633
634
635
# File 'lib/rubasteme/ast/branch_node.rb', line 633

def identifier
  @nodes[0]
end

#identifier=(node) ⇒ Object



637
638
639
# File 'lib/rubasteme/ast/branch_node.rb', line 637

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

#initObject



641
642
643
# File 'lib/rubasteme/ast/branch_node.rb', line 641

def init
  @nodes[1]
end

#init=(node) ⇒ Object



645
646
647
# File 'lib/rubasteme/ast/branch_node.rb', line 645

def init=(node)
  @nodes[1] = node
end

#stepObject



649
650
651
# File 'lib/rubasteme/ast/branch_node.rb', line 649

def step
  @nodes[2]
end

#step=(node) ⇒ Object



653
654
655
# File 'lib/rubasteme/ast/branch_node.rb', line 653

def step=(node)
  @nodes[2] = node
end