Class: Reforge::Transformation::Tree::AggregateNode::HashNode

Inherits:
Object
  • Object
show all
Defined in:
lib/reforge/transformation/tree/aggregate_node/hash_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHashNode

Returns a new instance of HashNode.



10
11
12
# File 'lib/reforge/transformation/tree/aggregate_node/hash_node.rb', line 10

def initialize
  @children = {}
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



8
9
10
# File 'lib/reforge/transformation/tree/aggregate_node/hash_node.rb', line 8

def children
  @children
end

Instance Method Details

#call(source) ⇒ Object



14
15
16
# File 'lib/reforge/transformation/tree/aggregate_node/hash_node.rb', line 14

def call(source)
  children.transform_values { |child| child.call(source) }
end

#update_path(path) ⇒ Object



18
19
20
# File 'lib/reforge/transformation/tree/aggregate_node/hash_node.rb', line 18

def update_path(path)
  children.each { |key, child| child.update_path(path + [key]) }
end