Class: Remap::Rule::Path
- Defined in:
- lib/remap/rule/support/path.rb
Instance Method Summary collapse
-
#call(state) {|| ... } ⇒ State<T>
Maps state from map to block to to.
Instance Method Details
#call(state) {|| ... } ⇒ State<T>
Maps state from map to block to to
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/remap/rule/support/path.rb', line 22 def call(state, &block) unless block raise ArgumentError, "block required" end selector(state).then(&block).fmap do |value| to.reverse.reduce(value) do |val, key| { key => val } end end._ end |