resource-struct 0.2.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/bin/console +1 -1
- data/lib/resource_struct/firm_struct.rb +7 -3
- data/lib/resource_struct/loose_struct.rb +7 -3
- data/lib/resource_struct/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3435cd92f2c4374cfd84a3411fd5a9d42fdd80f3e9ef1a13b847d302ba3fd313
|
4
|
+
data.tar.gz: 79ffe2f000b766de16130742bfd1a087222bf2d6c9ebf70dc9b328f2cdeb3394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c74aece00d81f98c1cd6bc7b42cd4d6fdf43a60493cd247bc30f949e844cc048b28853c33f73acc18bc3a2fa6ad70bbe9438ec3a7ab56086cc5f73ca0db3de7
|
7
|
+
data.tar.gz: 413595f3fc61327671dc6c499477f7208bd8d6095e7b429e276c5b9082b4dc670bab7b40424f7ef4d4bb2a7cc8850e40809010258c007916cab0cb6141e6566b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/bin/console
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "bundler/setup"
|
5
|
-
require "resource
|
5
|
+
require "resource-struct"
|
6
6
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -105,12 +105,16 @@ module ResourceStruct
|
|
105
105
|
def ___all_keys_equal(other)
|
106
106
|
return false unless @hash.count == other.count
|
107
107
|
|
108
|
-
@hash.reduce(true) do |acc, (k,
|
108
|
+
@hash.reduce(true) do |acc, (k, _)|
|
109
|
+
value = self[k]
|
109
110
|
if other.key?(k)
|
110
|
-
acc && other[k]
|
111
|
+
acc && value == other[k]
|
112
|
+
elsif k.is_a?(String)
|
113
|
+
ck = k.to_sym
|
114
|
+
acc && other.key?(ck) && value == other[ck]
|
111
115
|
else
|
112
116
|
ck = ___convert_key(k)
|
113
|
-
acc && other.key?(ck) && other[ck]
|
117
|
+
acc && other.key?(ck) && value == other[ck]
|
114
118
|
end
|
115
119
|
end
|
116
120
|
end
|
@@ -102,12 +102,16 @@ module ResourceStruct
|
|
102
102
|
def ___all_keys_equal(other)
|
103
103
|
return false unless @hash.count == other.count
|
104
104
|
|
105
|
-
@hash.reduce(true) do |acc, (k,
|
105
|
+
@hash.reduce(true) do |acc, (k, _)|
|
106
|
+
value = self[k]
|
106
107
|
if other.key?(k)
|
107
|
-
acc && other[k]
|
108
|
+
acc && value == other[k]
|
109
|
+
elsif k.is_a?(String)
|
110
|
+
ck = k.to_sym
|
111
|
+
acc && other.key?(ck) && value == other[ck]
|
108
112
|
else
|
109
113
|
ck = ___convert_key(k)
|
110
|
-
acc && other.key?(ck) && other[ck]
|
114
|
+
acc && other.key?(ck) && value == other[ck]
|
111
115
|
end
|
112
116
|
end
|
113
117
|
end
|