hashlib 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/hashlib.rb +15 -3
  2. 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.map(&:stringify_keys)
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.stringify_keys()
190
+ v = v.symbolize_keys()
185
191
  elsif v.is_a?(Array)
186
- v = v.map(&:stringify_keys)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: