hash_easy 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/Gemfile.lock +4 -1
- data/lib/hash_easy/bottomless_hash.rb +12 -10
- data/lib/hash_easy/version.rb +1 -1
- 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: a5c842b68e8d11c9449bd131427ce38bbd4e6b50
|
4
|
+
data.tar.gz: d95082c9b85149b9da2dc062d3551ba28766d870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8f3b4994bdb1f34d4d2e1c05bfd3016a4aa53cf0fca591267b8d8b731f658cefbd64e1ca0ba54c943e9ab982f9030b4b7f55b45686caf603c32935ade8fde4d
|
7
|
+
data.tar.gz: 73c724af3d76c9ba060a82e6a27d869d57537af36532b973b494af546d48ec00ab26250e890c2ab4c92530183c4c20218b483a7492a9ca34cbebbd08045b7411
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module HashEasy
|
2
|
+
class BottomlessHash < Hash
|
3
|
+
def initialize
|
4
|
+
super &-> h, k { h[k] = self.class.new }
|
5
|
+
end
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
def self.from_hash(hash)
|
8
|
+
new.merge(hash)
|
9
|
+
end
|
8
10
|
end
|
9
|
-
end
|
10
11
|
|
11
|
-
class Hash
|
12
|
-
|
13
|
-
|
12
|
+
class Hash
|
13
|
+
def bottomless
|
14
|
+
BottomlessHash.from_hash(self)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/hash_easy/version.rb
CHANGED