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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fceef99a782c47ebc49c3838188470d7733a92df5402f94e4acb343963a3af88
4
- data.tar.gz: 04b4536366245c5a31710d35830f8144271fdb369cd1a69d0a1ca0b6d609b95d
3
+ metadata.gz: bcce8ed41e4305d060c11dfc15337adc715765bedc8e7471dadb2fc0bbb5311c
4
+ data.tar.gz: fe3ee3f15ed49d7e57376a49a2822e691dbb623abae61b07d25748a5cee134f2
5
5
  SHA512:
6
- metadata.gz: d0ef79f4049cfe582f4516111c70f0568ade844a659c13e5e7d65b87651d14a8d938de3fcae525c274266f9bb66021babdc455f02f3cd9367f90dcd5b33f69ba
7
- data.tar.gz: 50acd2a2dd7ff2a280cd978f2b37ae7edd71b54e41b0c4e6bdae31b955148daee2fd9980f8aefa21d61d47bcfa6e8ebe1df46281808a333482bdedd480f0d8af
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: "<jd@example.com>"}
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: "<jd@example.com>"}
820
+ # {name: "Jayne", email: "jd@example.com"}
821
821
  ----
822
822
 
823
823
  The original object _is_ mutated:
@@ -88,8 +88,8 @@ module Refinements
88
88
 
89
89
  def transform_with(**) = dup.transform_with!(**)
90
90
 
91
- def transform_with!(**mutations)
92
- mutations.each { |key, function| transform_value! key, &function }
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "refinements"
5
- spec.version = "13.0.0"
5
+ spec.version = "13.0.1"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/refinements"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinements
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.0.0
4
+ version: 13.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
metadata.gz.sig CHANGED
Binary file