remap 2.1.32 → 2.1.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remap/path/input.rb +5 -4
- data/lib/remap/path/output.rb +2 -2
- data/lib/remap/path.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f28ba555d64f3827d6d666f9c3c5460240d8b746618eb045cc372e0ad24f11
|
4
|
+
data.tar.gz: f7b6c164565aa2d6b74315f7905ab45aff8e933bd87e925b4c61c8289f143f59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6325562e5f1999297231fdefd782c20ab028e823d73f146a5d146acc4c8bcaa875623dfb8225a1e1ffcb5f853b8b099ae2c6f1d44d90b2f59731b0484fedce6e
|
7
|
+
data.tar.gz: 7d94a42229ab0f64d418bc95589bc46fa05b8a2d42feb61b8948327b0b9b205bf90bd042794c0cac0267ee791a862bb60be582944621595432f13b152b0b65a5
|
data/lib/remap/path/input.rb
CHANGED
@@ -16,19 +16,20 @@ module Remap
|
|
16
16
|
# end
|
17
17
|
class Input < Unit
|
18
18
|
# @return [Array<Selector>]
|
19
|
-
attribute :
|
19
|
+
attribute :selectors, [Selector]
|
20
20
|
|
21
|
-
# Selects the value at the path {#segments}
|
22
|
-
#
|
23
21
|
# @param state [State]
|
24
22
|
#
|
23
|
+
# @yieldparam [State]
|
24
|
+
# @yieldreturn [State]
|
25
|
+
#
|
25
26
|
# @return [State]
|
26
27
|
def call(state, &iterator)
|
27
28
|
unless block_given?
|
28
29
|
raise ArgumentError, "Input path requires an iterator block"
|
29
30
|
end
|
30
31
|
|
31
|
-
|
32
|
+
selectors.reverse.reduce(iterator) do |inner_iterator, selector|
|
32
33
|
-> inner_state { selector.call(inner_state, &inner_iterator) }
|
33
34
|
end.call(state)
|
34
35
|
end
|
data/lib/remap/path/output.rb
CHANGED
@@ -13,12 +13,12 @@ module Remap
|
|
13
13
|
#
|
14
14
|
# result.fetch(:value) # => { a: { b: { c: "A" } } }
|
15
15
|
class Output < Unit
|
16
|
-
attribute :
|
16
|
+
attribute :selectors, [Types::Key]
|
17
17
|
|
18
18
|
# @return [State]
|
19
19
|
def call(state)
|
20
20
|
state.fmap do |value|
|
21
|
-
|
21
|
+
selectors.hide(value)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/remap/path.rb
CHANGED