Class: Rubasteme::AST::CondRecipientClauseNode

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

Instance Method Summary collapse

Methods inherited from RecipientClauseBaseNode

#recipient, #recipient=

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

Returns a new instance of CondRecipientClauseNode.



341
342
343
344
345
# File 'lib/rubasteme/ast/branch_node.rb', line 341

def initialize(_ = nil)
  # <cond clause> -> ( <test> => <recipient> )
  # @nodes = [<test>, <recipient>]
  super(2, 1, _)
end

Instance Method Details

#testObject



347
348
349
# File 'lib/rubasteme/ast/branch_node.rb', line 347

def test
  @nodes[0]
end

#test=(node) ⇒ Object



351
352
353
# File 'lib/rubasteme/ast/branch_node.rb', line 351

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