braintreehttp 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/braintreehttp/http_client.rb +14 -8
- data/lib/braintreehttp/version.rb +1 -1
- data/spec/braintreehttp/http_client_spec.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecd98d588354892b57adab08fd12f0436f40b460
|
4
|
+
data.tar.gz: ddb47e416589e2e70e2f5abd36a8dde40697b4ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dc5c2feda9a452c62114fb5edfa61cce9630e131f835aeaef179eb70a0f855c3577eb513bd97c098dd506a2949124c9c0f7a90484a42712f2f6057da06f3dea
|
7
|
+
data.tar.gz: 5d564e3a9cc44a65d6ee0c03352cc31eff36c9a1db7cee99b0ce2216b633318eaf3c48af336deba864c323bc012ea80149fd8b8ba8a2f6896fb6263647139642
|
@@ -71,7 +71,7 @@ module BraintreeHttp
|
|
71
71
|
if deserialized.is_a?(String) || deserialized.is_a?(Array)
|
72
72
|
result = deserialized
|
73
73
|
else
|
74
|
-
result =
|
74
|
+
result = _parse_values(deserialized)
|
75
75
|
end
|
76
76
|
else
|
77
77
|
result = nil
|
@@ -90,15 +90,21 @@ module BraintreeHttp
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
def
|
94
|
-
obj =
|
93
|
+
def _parse_values(values)
|
94
|
+
obj = nil
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
if values.is_a?(Array)
|
97
|
+
obj = []
|
98
|
+
values.each do |v|
|
99
|
+
obj << _parse_values(v)
|
100
|
+
end
|
101
|
+
elsif values.is_a?(Hash)
|
102
|
+
obj = OpenStruct.new()
|
103
|
+
values.each do |k, v|
|
104
|
+
obj[k] = _parse_values(v)
|
101
105
|
end
|
106
|
+
else
|
107
|
+
obj = values
|
102
108
|
end
|
103
109
|
|
104
110
|
obj
|
@@ -1 +1 @@
|
|
1
|
-
VERSION = "0.4.
|
1
|
+
VERSION = "0.4.3"
|
@@ -236,7 +236,9 @@ describe HttpClient do
|
|
236
236
|
:some_hash => {
|
237
237
|
:some_int => 1
|
238
238
|
},
|
239
|
-
:some_array => [
|
239
|
+
:some_array => [[{
|
240
|
+
:array_key => 'array-value'
|
241
|
+
}]]
|
240
242
|
}
|
241
243
|
}
|
242
244
|
|
@@ -252,7 +254,7 @@ describe HttpClient do
|
|
252
254
|
expect(resp.result.key).to eq('value')
|
253
255
|
expect(resp.result.nested_key.string).to eq('stringvalue')
|
254
256
|
expect(resp.result.nested_key.some_hash.some_int).to eq(1)
|
255
|
-
expect(resp.result.nested_key.some_array).to eq(
|
257
|
+
expect(resp.result.nested_key.some_array[0][0].array_key).to eq('array-value')
|
256
258
|
end
|
257
259
|
|
258
260
|
it "does not error if no file or body present on a request class" do
|