Class: Remap::Iteration::Hash

Inherits:
Concrete
  • Object
show all
Defined in:
lib/remap/iteration/hash.rb

Overview

Implements a hash iterator which defines key in state

Instance Method Summary collapse

Instance Method Details

#call(&block) ⇒ Object

See Also:

  • Iteration#map


16
17
18
19
20
# File 'lib/remap/iteration/hash.rb', line 16

def call(&block)
  hash.reduce(init) do |state, (key, value)|
    reduce(state, key, value, &block)
  end
end

#stateState<Hash>

Returns:



13
# File 'lib/remap/iteration/hash.rb', line 13

attribute :state, Types::State

#valueHash

Returns:



10
# File 'lib/remap/iteration/hash.rb', line 10

attribute :value, Types::Hash, alias: :hash