Class: Rubasteme::AST::RecipientClauseBaseNode

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(initial_size = 0, recipient_pos = 0, _ = nil) ⇒ RecipientClauseBaseNode

Returns a new instance of RecipientClauseBaseNode.



324
325
326
327
328
329
# File 'lib/rubasteme/ast/branch_node.rb', line 324

def initialize(initial_size = 0, recipient_pos = 0, _ = nil)
  # @nodes = [<recipient>]
  # <recipient> -> <expression>
  super(initial_size, _)
  @recipient_pos = recipient_pos
end

Instance Method Details

#recipientObject



331
332
333
# File 'lib/rubasteme/ast/branch_node.rb', line 331

def recipient
  @nodes[@recipient_pos]
end

#recipient=(node) ⇒ Object



335
336
337
# File 'lib/rubasteme/ast/branch_node.rb', line 335

def recipient=(node)
  @nodes[@recipient_pos] = node
end