google_rest 1.0.1 → 1.0.2

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/google_rest.rb +6 -4
  2. metadata +4 -4
data/lib/google_rest.rb CHANGED
@@ -214,10 +214,12 @@ module GoogleRest
214
214
 
215
215
  # A utility method for unescaping recursively HTML entities in JSON array or hash.
216
216
  def json_recursive_unescape(data)
217
- case data
218
- when String : json_unescape(data)
219
- when Hash : data.inject({}) { |hsh, (k,v)| hsh[k] = json_recursive_unescape(v);hsh }
220
- when Array : data.collect { |v| json_recursive_unescape(v) }
217
+ if data.is_a?(String)
218
+ json_unescape(data)
219
+ elsif data.is_a?(Hash)
220
+ data.inject({}) { |hsh, (k,v)| hsh[k] = json_recursive_unescape(v);hsh }
221
+ elsif data.is_a?(Array)
222
+ data.collect { |v| json_recursive_unescape(v) }
221
223
  end
222
224
  end
223
225
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_rest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Olivier Ruffin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-03 00:00:00 +02:00
18
+ date: 2011-11-13 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency