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.
- checksums.yaml +4 -4
- data/lib/gorilla-patch/hash.rb +12 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 736dcedf3bb0fef175844005b68af6f1388afe23
|
4
|
+
data.tar.gz: bb0d2c774d720c01416408e8dbe4904bac45341f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c576b11158ee2fc4029910aa53d9549b93ea6b8103397ebb403477e40aa12ae46973802192b316ebffdb4f583a16fea91858d7b28be84108474d4b8dbc292e2e
|
7
|
+
data.tar.gz: faaa55c9c9abf0710ef3a6ff374c0cfb599a1115f9352a679b1ec8a405bf8f252ec6987bdd8f26a3d417b0fab7760a432940a4c8b7def6e439b0f78efce94f30
|
data/lib/gorilla-patch/hash.rb
CHANGED
@@ -3,15 +3,24 @@ module GorillaPatch
|
|
3
3
|
|
4
4
|
refine Hash do
|
5
5
|
|
6
|
-
def
|
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
|
11
|
-
hash_sym =
|
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
|