Class: Ruby::ChainedBlock

Inherits:
NamedBlock show all
Defined in:
lib/ruby/block.rb

Direct Known Subclasses

If, When

Instance Attribute Summary

Attributes included from Node::Composite

#parent

Instance Method Summary collapse

Methods included from Ruby::Conversions::Statements

#to_block, #to_chained_block, #to_named_block, #to_program

Methods inherited from List

#method_missing

Methods included from Alternation::List

#<<, #[]=, #pop

Methods included from Ruby::Conversions::List

#to_array

Methods inherited from Aggregate

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

Methods inherited from Node

#<=>, #all_nodes, #column, #length, #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(identifier, blocks, statements, params = nil, ldelim = nil, rdelim = nil) ⇒ ChainedBlock

Returns a new instance of ChainedBlock.



33
34
35
36
# File 'lib/ruby/block.rb', line 33

def initialize(identifier, blocks, statements, params = nil, ldelim = nil, rdelim = nil)
  self.blocks = Array(blocks) || []
  super(identifier, statements, params, ldelim, rdelim)
end

Dynamic Method Handling

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

Instance Method Details

#nodesObject



38
39
40
# File 'lib/ruby/block.rb', line 38

def nodes
  [identifier, params, ldelim, elements, blocks, rdelim].flatten.compact
end