Class: Ruby::Params

Inherits:
DelimitedList show all
Defined in:
lib/ruby/params.rb

Direct Known Subclasses

RescueParams

Instance Attribute Summary

Attributes included from Node::Composite

#parent

Instance Method Summary collapse

Methods inherited from DelimitedList

#nodes

Methods inherited from List

#method_missing, #nodes

Methods included from 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(params = nil, ldelim = nil, rdelim = nil) ⇒ Params

Returns a new instance of Params.



6
7
8
9
# File 'lib/ruby/params.rb', line 6

def initialize(params = nil, ldelim = nil, rdelim = nil)
  params = Array(params).map { |param| param.is_a?(Ruby::Param) ? param : Ruby::Param.new(param) }
  super
end

Dynamic Method Handling

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

Instance Method Details

#<<(param) ⇒ Object



11
12
13
14
# File 'lib/ruby/params.rb', line 11

def <<(param)
  param = Ruby::Param.new(param) unless param.is_a?(Ruby::Param)
  super
end