Class: Hydrangea::NodesByValue

Inherits:
ManyNodes show all
Defined in:
lib/hydrangea/nodes_by_value.rb

Instance Method Summary collapse

Methods inherited from ManyNodes

#pass

Constructor Details

#initialize(transform) ⇒ NodesByValue

Returns a new instance of NodesByValue.



5
6
7
8
# File 'lib/hydrangea/nodes_by_value.rb', line 5

def initialize(transform)
  @transform = transform
  @nodes = transform.untransformed.reduce({}) { |h,n| h[n.value] = n; h }
end

Instance Method Details

#nodesObject



10
11
12
# File 'lib/hydrangea/nodes_by_value.rb', line 10

def nodes
  map(&:last)
end