social_profile 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,8 +27,8 @@ module SocialProfile
27
27
 
28
28
  class Album
29
29
 
30
- def initialize(hash, target)
31
- @hash = Array.wrap(hash["response"]).first || {}
30
+ def initialize(response, target)
31
+ @hash = normalize_hash(response)
32
32
  @target = target
33
33
  end
34
34
 
@@ -84,6 +84,11 @@ module SocialProfile
84
84
  nil
85
85
  end
86
86
  end
87
+
88
+ def normalize_hash(hash)
89
+ response = (hash && hash["response"] ? Array.wrap(hash["response"]).first : hash)
90
+ response || {}
91
+ end
87
92
  end
88
93
 
89
94
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SocialProfile
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_profile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-28 00:00:00.000000000 Z
12
+ date: 2013-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler