Class: Rubasteme::AST::ListNode
Direct Known Subclasses
AndNode, AssignmentNode, BindSpecNode, BindingsNode, CaseNode, CondNode, ConditionalNode, DataNode, DoNode, FormalsNode, HoldingSequenceBaseNode, IdentifierDefinitionNode, InternalDefinitionsNode, IterationBindingsNode, IterationSpecNode, LambdaExpressionNode, LetBaseNode, LetNode, OrNode, ProcedureCallNode, QuotationNode, RecipientClauseBaseNode, SequenceNode
Instance Method Summary
collapse
Methods inherited from BranchNode
#<<, #[], #[]=, #each, #size, #to_a
Methods inherited from Node
#to_a, #to_s, #type
Constructor Details
#initialize(initial_size = 0, _ = nil) ⇒ ListNode
Returns a new instance of ListNode.
58
59
60
|
# File 'lib/rubasteme/ast/branch_node.rb', line 58
def initialize(initial_size = 0, _ = nil)
super(initial_size)
end
|
Instance Method Details
#elements ⇒ Object
74
75
76
|
# File 'lib/rubasteme/ast/branch_node.rb', line 74
def elements
@nodes
end
|
#empty? ⇒ Boolean
62
63
64
|
# File 'lib/rubasteme/ast/branch_node.rb', line 62
def empty?
@nodes.empty?
end
|
#first ⇒ Object
66
67
68
|
# File 'lib/rubasteme/ast/branch_node.rb', line 66
def first
@nodes[0]
end
|
#rest ⇒ Object
70
71
72
|
# File 'lib/rubasteme/ast/branch_node.rb', line 70
def rest
@nodes[1..-1]
end
|