Class: Ruby::When
- Inherits:
-
ChainedBlock
- Object
- Node
- Aggregate
- List
- DelimitedList
- Statements
- Block
- NamedBlock
- ChainedBlock
- Ruby::When
- Defined in:
- lib/ruby/case.rb
Instance Attribute Summary
Attributes included from Node::Composite
Instance Method Summary collapse
-
#initialize(identifier, expression, statements, ldelim = nil, block = nil) ⇒ When
constructor
A new instance of When.
- #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, expression, statements, ldelim = nil, block = nil) ⇒ When
Returns a new instance of When.
21 22 23 24 |
# File 'lib/ruby/case.rb', line 21 def initialize(identifier, expression, statements, ldelim = nil, block = nil) self.expression = expression super(identifier, [block], statements, nil, ldelim) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ruby::List
Instance Method Details
#nodes ⇒ Object
26 27 28 |
# File 'lib/ruby/case.rb', line 26 def nodes [identifier, expression, ldelim, elements, blocks, rdelim].flatten.compact end |