hash_wrap 0.3.2 → 0.3.3
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/hash_wrap/version.rb +1 -1
- data/lib/hash_wrap.rb +10 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57e71dcb9d3a5f47d86bedfb39a5be22eb1f32b03b54ed8482b09f4cf202ee44
|
4
|
+
data.tar.gz: 8f28a404fe3a0203f4a772cf75e2eff2d398ee47306e055f624490b872f4e337
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e3ebeafc6a4ce49c89befe5491d914c3ec9ef34d83e7db2016c17ee2ff008aa16453febdb51ae4d12faea674fcf6712e8adb37ef7448d196d548aee4ace63ee
|
7
|
+
data.tar.gz: 2092e0253830a81a3dd3704b7da0c27f24984b1d1e9d6fc451ac2b35c9fec6db5116da0e070001dd621f6b6ef19966fe903a44807e9bee804dcebb9bb4d8a2ab
|
data/lib/hash_wrap/version.rb
CHANGED
data/lib/hash_wrap.rb
CHANGED
@@ -14,8 +14,8 @@ class HashWrap
|
|
14
14
|
|
15
15
|
def method_missing(meth, *args, &blk)
|
16
16
|
# handle both string and symbol keys
|
17
|
-
value = @hash.fetch meth
|
18
|
-
@hash.fetch meth do |_key|
|
17
|
+
value = @hash.fetch meth do |_key|
|
18
|
+
@hash.fetch meth.to_s do |_key|
|
19
19
|
super
|
20
20
|
end
|
21
21
|
end
|
@@ -42,7 +42,14 @@ class HashWrap
|
|
42
42
|
private def __hash__; @hash end
|
43
43
|
|
44
44
|
def == rhs
|
45
|
-
|
45
|
+
case rhs
|
46
|
+
when self.class
|
47
|
+
__hash__ == rhs.send(:__hash__)
|
48
|
+
when Hash
|
49
|
+
__hash__ == rhs.to_h
|
50
|
+
else
|
51
|
+
false
|
52
|
+
end
|
46
53
|
end
|
47
54
|
|
48
55
|
def each &blk
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_wrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'HoHA being Hash of Hashes and Arrays. If it doesn''t work for you, rather
|
14
14
|
than scope-creeping this consider: Hash, OpenStruct, a class, etc.'
|