hashlib 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hashlib.rb +15 -3
- metadata +1 -1
data/lib/hashlib.rb
CHANGED
@@ -168,7 +168,13 @@ class Hash
|
|
168
168
|
if v.is_a?(Hash)
|
169
169
|
v = v.stringify_keys()
|
170
170
|
elsif v.is_a?(Array)
|
171
|
-
v = v.
|
171
|
+
v = v.collect do |i|
|
172
|
+
if i.is_a?(Hash)
|
173
|
+
i.stringify_keys()
|
174
|
+
else
|
175
|
+
i
|
176
|
+
end
|
177
|
+
end
|
172
178
|
end
|
173
179
|
|
174
180
|
rv[k.to_s] = v
|
@@ -181,9 +187,15 @@ class Hash
|
|
181
187
|
rv = {}
|
182
188
|
each do |k, v|
|
183
189
|
if v.is_a?(Hash)
|
184
|
-
v = v.
|
190
|
+
v = v.symbolize_keys()
|
185
191
|
elsif v.is_a?(Array)
|
186
|
-
v = v.
|
192
|
+
v = v.collect do |i|
|
193
|
+
if i.is_a?(Hash)
|
194
|
+
i.symbolize_keys()
|
195
|
+
else
|
196
|
+
i
|
197
|
+
end
|
198
|
+
end
|
187
199
|
end
|
188
200
|
|
189
201
|
rv[(k.to_sym rescue k)] = v
|