gorilla-patch 2.4.3 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed2d37d8f562e53b8211540f047ca8e3d9f239d5
4
- data.tar.gz: 6cd40564c632f562f5d05684b73f66173dcb3477
3
+ metadata.gz: c92746c534a356fac88208ce5b848c3abc7a0b39
4
+ data.tar.gz: 23e6e0a2d2f06f10c42c489001acd0839816e188
5
5
  SHA512:
6
- metadata.gz: fdaa4d24975c317cb7f129b344c77eaa3e5bb3e39dd8ca8a61de4035da473182c52dc82d51217ce776ee0219b55fd856eee5ad8e7581d22bfa1b17d521c9b9a1
7
- data.tar.gz: bb92704e0b8830e5fa6ba4d35cf3f3958e7c9254b6372be7e0c82e37f208c64403b00caaf9b2f2c5f95b052794056240af5b03278c6d58a168957d3c86b619ed
6
+ metadata.gz: acd9931edc33b37a19abd82cfaefce28bbff02b3e709efce2c6e0a6a72f708a17f170158f376c22e73ea55b3ff53b312a03004468d3e670bbb9ff604092118dc
7
+ data.tar.gz: 5db3c70d3f3887bdf2f3f8251e88c3dfc8274a311bd8a7b3290f2398cf86cc1ad7224588c6d3dedcb8305a4cc757317c76b83e43ab4302dd7c8097f962a44f1b
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GorillaPatch
4
+ ## Module for transformations methods
5
+ module Transform
6
+ refine Hash do
7
+ def transform_values
8
+ return super if defined? super
9
+ each_with_object(self.class.new) do |(key, value), result|
10
+ result[key] = yield value
11
+ end
12
+ end
13
+
14
+ def transform_values!
15
+ return super if defined? super
16
+ each do |key, value|
17
+ self[key] = yield value
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorilla-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.3
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
@@ -127,6 +127,7 @@ files:
127
127
  - lib/gorilla-patch/namespace.rb
128
128
  - lib/gorilla-patch/slice.rb
129
129
  - lib/gorilla-patch/symbolize.rb
130
+ - lib/gorilla-patch/transform.rb
130
131
  - lib/gorilla-patch/truncate.rb
131
132
  homepage: https://github.com/AlexWayfer/gorilla-patch
132
133
  licenses: