Class: Rubasteme::AST::CaseNode
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) ⇒ CaseNode
Returns a new instance of CaseNode.
364
365
366
367
|
# File 'lib/rubasteme/ast/branch_node.rb', line 364
def initialize(_ = nil)
super(1, _)
end
|
Instance Method Details
#add_clause(node) ⇒ Object
381
382
383
|
# File 'lib/rubasteme/ast/branch_node.rb', line 381
def add_clause(node)
@nodes << node
end
|
#case_clauses ⇒ Object
377
378
379
|
# File 'lib/rubasteme/ast/branch_node.rb', line 377
def case_clauses
@nodes[1..-1]
end
|
#expression ⇒ Object
369
370
371
|
# File 'lib/rubasteme/ast/branch_node.rb', line 369
def expression
@nodes[0]
end
|
#expression=(node) ⇒ Object
373
374
375
|
# File 'lib/rubasteme/ast/branch_node.rb', line 373
def expression=(node)
@nodes[0] = node
end
|