refinements 13.0.0 → 13.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +3 -3
- data/lib/refinements/hash.rb +2 -2
- data/refinements.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcce8ed41e4305d060c11dfc15337adc715765bedc8e7471dadb2fc0bbb5311c
|
4
|
+
data.tar.gz: fe3ee3f15ed49d7e57376a49a2822e691dbb623abae61b07d25748a5cee134f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 105c86339f198f838bea4b592eee4a1305e540d057082c1a426f160a6d1fc68f8c30bfc96a06532ea32f066983690ed28decd2a8a8b7277101d865ee4f13341d
|
7
|
+
data.tar.gz: e023f9d0560cc45d3e43748de55bca3d184d7eaec6819e52159450721b05f66a3e89df7efdcf823168695378a2aea89e3151a8b902dd6c3efe50ad0e525a9ab5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -781,7 +781,7 @@ example = {name: "Jayne Doe", email: "<jd@example.com>"}
|
|
781
781
|
|
782
782
|
example.transform_with name: -> value { value.delete_suffix " Doe" },
|
783
783
|
email: -> value { value.tr "<>", "" }
|
784
|
-
# {name: "Jayne", email: "jd@example.com"}
|
784
|
+
# {name: "Jayne Doe", email: "<jd@example.com>"}
|
785
785
|
----
|
786
786
|
|
787
787
|
Invalid keys are ignored:
|
@@ -789,7 +789,7 @@ Invalid keys are ignored:
|
|
789
789
|
[source,ruby]
|
790
790
|
----
|
791
791
|
example.transform_with bogus: -> value { value.tr "<>", "" }
|
792
|
-
# {email: "
|
792
|
+
# {name: "Jayne Doe", email: "jd@example.com"}
|
793
793
|
----
|
794
794
|
|
795
795
|
The original object _is not_ mutated:
|
@@ -817,7 +817,7 @@ Invalid keys are ignored:
|
|
817
817
|
[source,ruby]
|
818
818
|
----
|
819
819
|
example.transform_with! bogus: -> value { value.tr "<>", "" }
|
820
|
-
# {email: "
|
820
|
+
# {name: "Jayne", email: "jd@example.com"}
|
821
821
|
----
|
822
822
|
|
823
823
|
The original object _is_ mutated:
|
data/lib/refinements/hash.rb
CHANGED
@@ -88,8 +88,8 @@ module Refinements
|
|
88
88
|
|
89
89
|
def transform_with(**) = dup.transform_with!(**)
|
90
90
|
|
91
|
-
def transform_with!(**
|
92
|
-
|
91
|
+
def transform_with!(**operations)
|
92
|
+
operations.each { |key, function| self[key] = function.call self[key] if key? key }
|
93
93
|
self
|
94
94
|
end
|
95
95
|
|
data/refinements.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|