Class: Ruby::ArgsList

Inherits:
DelimitedList show all
Includes:
Ruby::Alternation::ArgsList
Defined in:
lib/ruby/args.rb

Instance Attribute Summary

Attributes included from Node::Composite

#parent

Instance Method Summary collapse

Methods included from Ruby::Alternation::ArgsList

#options, #set_option

Methods inherited from DelimitedList

#nodes

Methods inherited from List

#method_missing, #nodes

Methods included from Ruby::Alternation::List

#[]=, #pop

Methods included from Conversions::List

#to_array

Methods inherited from Aggregate

#position, #position=, #prolog, #prolog=, #to_ruby

Methods inherited from Node

#<=>, #all_nodes, #column, #length, #nodes, #row

Methods included from Conversions

included, #to_node

Methods included from Node::Traversal

#has_token?, #has_type?, #has_value?, #is_instance_of?, #left_of?, #matches?, #position?, #right_of?, #select

Methods included from Node::Source

#context, #filename, #line, #lines, #src

Methods included from Node::Composite

included, #root, #root?

Constructor Details

#initialize(args = nil, ldelim = nil, rdelim = nil) ⇒ ArgsList

Returns a new instance of ArgsList.



9
10
11
12
# File 'lib/ruby/args.rb', line 9

def initialize(args = nil, ldelim = nil, rdelim = nil)
  args = Array(args).map { |arg| arg.is_a?(Ruby::Arg) ? arg : Ruby::Arg.new(arg) }
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ruby::List

Instance Method Details

#<<(arg) ⇒ Object



14
15
16
17
# File 'lib/ruby/args.rb', line 14

def <<(arg)
  arg = Ruby::Arg.new(arg) unless arg.is_a?(Ruby::Arg)
  super
end