Class: Ruby::For
- Inherits:
-
NamedBlock
- Object
- Node
- Aggregate
- List
- DelimitedList
- Statements
- Block
- NamedBlock
- Ruby::For
- Defined in:
- lib/ruby/for.rb
Instance Attribute Summary
Attributes included from Node::Composite
Instance Method Summary collapse
-
#initialize(identifier, variable, operator, range, statements, ldelim = nil, rdelim = nil) ⇒ For
constructor
A new instance of For.
- #nodes ⇒ Object
Methods included from Conversions::Statements
#to_block, #to_chained_block, #to_named_block, #to_program
Methods inherited from List
Methods included from Alternation::List
Methods included from Conversions::List
Methods inherited from Aggregate
#position, #position=, #prolog, #prolog=, #to_ruby
Methods inherited from Node
#<=>, #all_nodes, #column, #length, #row
Methods included from Conversions
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
Constructor Details
#initialize(identifier, variable, operator, range, statements, ldelim = nil, rdelim = nil) ⇒ For
Returns a new instance of For.
7 8 9 10 11 12 |
# File 'lib/ruby/for.rb', line 7 def initialize(identifier, variable, operator, range, statements, ldelim = nil, rdelim = nil) self.variable = variable self.operator = operator self.range = range super(identifier, statements, nil, ldelim, rdelim) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ruby::List
Instance Method Details
#nodes ⇒ Object
14 15 16 |
# File 'lib/ruby/for.rb', line 14 def nodes [identifier, variable, operator, range, ldelim, elements, rdelim].flatten.compact end |