cloudsponge 0.9.4 → 0.9.6
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.
- data/lib/cloudsponge.rb +1 -1
- data/lib/cloudsponge/contact.rb +2 -2
- data/lib/cloudsponge/utility.rb +2 -2
- metadata +3 -3
data/lib/cloudsponge.rb
CHANGED
data/lib/cloudsponge/contact.rb
CHANGED
@@ -28,11 +28,11 @@ module Cloudsponge
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def email
|
31
|
-
get_first_value(self.emails)
|
31
|
+
Contact.get_first_value(self.emails)
|
32
32
|
end
|
33
33
|
|
34
34
|
def phone
|
35
|
-
get_first_value(self.phones)
|
35
|
+
Contact.get_first_value(self.phones)
|
36
36
|
end
|
37
37
|
|
38
38
|
def add_array_value(collection, value, type = nil)
|
data/lib/cloudsponge/utility.rb
CHANGED
@@ -31,7 +31,7 @@ module Cloudsponge
|
|
31
31
|
def self.decode_response(response)
|
32
32
|
if response.code_type == Net::HTTPOK
|
33
33
|
# decode the response into an asscoiative array
|
34
|
-
resp =
|
34
|
+
resp = decode_response_body(response.body, 'json')
|
35
35
|
raise CsException.new(resp['error']['message'], response['code']) if resp['error']
|
36
36
|
else
|
37
37
|
raise CsException.new(response.body, response.code)
|
@@ -39,7 +39,7 @@ module Cloudsponge
|
|
39
39
|
resp
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.
|
42
|
+
def self.decode_response_body(response, format = 'json')
|
43
43
|
# TODO: account for systems that use a different JSON parser. Look for json gem...
|
44
44
|
# TODO: implement alternate formats: XML
|
45
45
|
object = {'error' => {'message' => 'failed to parse data.', 'code' => 1}}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 0.9.
|
8
|
+
- 6
|
9
|
+
version: 0.9.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Graeme Rouse
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-04 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|