gorilla-patch 0.0.1 → 0.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gorilla-patch/hash.rb +12 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e86f0a18b202f65421f816dec4cc4681716107ea
4
- data.tar.gz: e8e192ab64c145cf72ac39d13c21c8ebc84f13ec
3
+ metadata.gz: 736dcedf3bb0fef175844005b68af6f1388afe23
4
+ data.tar.gz: bb0d2c774d720c01416408e8dbe4904bac45341f
5
5
  SHA512:
6
- metadata.gz: 993f5953b88edc8b5ccc62172390de0c3bd58fbc9b3edd9be942728cd9999be0c2142083127197275341c59911dae2af66b81fcdbff53de9c8af81807c6677e7
7
- data.tar.gz: b63725eefee76e849d548497aed4e8ab6653966b31f9e02fb1de6cc9e78a83525a2d42a19b02903c2794138a50bf2f14c1f8054507d77d5b471cc1e31f762b87
6
+ metadata.gz: c576b11158ee2fc4029910aa53d9549b93ea6b8103397ebb403477e40aa12ae46973802192b316ebffdb4f583a16fea91858d7b28be84108474d4b8dbc292e2e
7
+ data.tar.gz: faaa55c9c9abf0710ef3a6ff374c0cfb599a1115f9352a679b1ec8a405bf8f252ec6987bdd8f26a3d417b0fab7760a432940a4c8b7def6e439b0f78efce94f30
@@ -3,15 +3,24 @@ module GorillaPatch
3
3
 
4
4
  refine Hash do
5
5
 
6
- def to_sym_keys
6
+ def keys_to_sym
7
7
  inject({}) { | hash_sym, (key, val) | hash_sym[key.to_sym] = val; hash_sym }
8
8
  end
9
9
 
10
- def to_sym_keys!
11
- hash_sym = to_sym_keys
10
+ def keys_to_sym!
11
+ hash_sym = keys_to_sym
12
12
  self.clear.merge! hash_sym
13
13
  end
14
14
 
15
+ def keys_to_s
16
+ inject({}) { | hash_s, (key, val) | hash_s[key.to_s] = val; hash_s }
17
+ end
18
+
19
+ def keys_to_s!
20
+ hash_s = keys_to_s
21
+ self.clear.merge! hash_s
22
+ end
23
+
15
24
  end
16
25
 
17
26
  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: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov