Class: Ruby::DelimitedVariable

Inherits:
DelimitedAggregate show all
Defined in:
lib/ruby/aggregate.rb

Instance Attribute Summary

Attributes included from Node::Composite

#parent

Instance Method Summary collapse

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, ldelim = nil) ⇒ DelimitedVariable

Returns a new instance of DelimitedVariable.



54
55
56
57
# File 'lib/ruby/aggregate.rb', line 54

def initialize(identifier, ldelim = nil)
  self.identifier = identifier
  super(ldelim)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



67
68
69
# File 'lib/ruby/aggregate.rb', line 67

def method_missing(method, *args, &block)
  identifier.respond_to?(method) ? identifier.send(method, *args, &block) : super
end

Instance Method Details

#nodesObject



63
64
65
# File 'lib/ruby/aggregate.rb', line 63

def nodes
  [ldelim, identifier].compact
end

#valueObject



59
60
61
# File 'lib/ruby/aggregate.rb', line 59

def value
  identifier.token.to_sym
end