Class: Remap::Path::Output

Inherits:
Unit
  • Object
show all
Defined in:
lib/remap/path/output.rb

Overview

Sets the value to a given path

Examples:

Maps “A” to { a: { b: { c: “A” } } }

state = Remap::State.call("A")
result = Remap::Path::Output.new([:a, :b, :c]).call(state)

result.fetch(:value) # => { a: { b: { c: "A" } } }

Instance Method Summary collapse

Instance Method Details

#call(state) ⇒ State

Returns:



19
20
21
22
23
# File 'lib/remap/path/output.rb', line 19

def call(state)
  state.fmap do |value|
    selectors.hide(value)
  end
end