apidiesel 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b39ac0517ac084b503f0db39b853bdfefa19390
4
- data.tar.gz: b9085eab41a864aa333a0fba0432a9ce2598f066
3
+ metadata.gz: 99168d8b1698ce3a3154178081267af94fa768ef
4
+ data.tar.gz: 74e74db6ff6721aeef9966eb629d79961564dabe
5
5
  SHA512:
6
- metadata.gz: a1b8a6eced3f7d3ac7b76b8f0c56e8e586eecf6399da2eb28ab56ddd0b0bd4bd95c24cdd60d8781a72e250222c56477945f9cc39456bc3b50dc6ec463a1fc7bb
7
- data.tar.gz: b8bf959da7e61304ba816e3aea79f2fa0773e9ea1ba71145b0848c97247f5d16fe5a60af4b99c73373e40ff8e21162c0ed67b274724c0306febd4d99922c5044
6
+ metadata.gz: cc11532fbc03e1e71dee627e6b72fc0b8fbcc2c601b48fae335a62d672ee06d880790f4164c422a01d8f0837c4c56b13c786c40a2a8a4ac1b489b0c06cc0cb90
7
+ data.tar.gz: a4bd9177d8fb13a31ffc7983cad005c6a9a9ead3464ecf316ef6c916e3b53cf13aed6c2d1f09e905abd24edf7b3a434f981b1e7fde5b704ca9871de3d066fb08
@@ -162,21 +162,30 @@ module Apidiesel
162
162
  Apidiesel::Request.new action: self, parameters: params
163
163
  end
164
164
 
165
- def process_response(response_hash)
165
+ def process_response(response_data)
166
166
  processed_result = {}
167
167
 
168
- response_hash.deep_symbolize_keys!
168
+ response_data = case response_data
169
+ when Hash
170
+ response_data.deep_symbolize_keys
171
+ when Array
172
+ response_data.map do |element|
173
+ element.is_a?(Hash) ? element.deep_symbolize_keys : element
174
+ end
175
+ else
176
+ response_data
177
+ end
169
178
 
170
179
  if self.class.response_filters.none? && self.class.response_formatters.none?
171
- return response_hash
180
+ return response_data
172
181
  end
173
182
 
174
183
  self.class.response_filters.each do |filter|
175
- response_hash = filter.call(response_hash)
184
+ response_data = filter.call(response_data)
176
185
  end
177
186
 
178
187
  self.class.response_formatters.each do |filter|
179
- processed_result = filter.call(response_hash, processed_result)
188
+ processed_result = filter.call(response_data, processed_result)
180
189
  end
181
190
 
182
191
  processed_result
@@ -1,3 +1,3 @@
1
1
  module Apidiesel
2
- VERSION = "0.7"
2
+ VERSION = "0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidiesel
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan-Christian Foeh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-27 00:00:00.000000000 Z
11
+ date: 2015-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport