Class: Ruby::Assoc

Inherits:
Aggregate show all
Defined in:
lib/ruby/assoc.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(key, value, operator) ⇒ Assoc

Returns a new instance of Assoc.



7
8
9
10
11
# File 'lib/ruby/assoc.rb', line 7

def initialize(key, value, operator)
  self.key = key
  self.value = value
  self.operator = operator
end

Instance Method Details

#nodesObject



13
14
15
# File 'lib/ruby/assoc.rb', line 13

def nodes
  [key, operator, value].compact
end