apidiesel 0.7 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apidiesel/action.rb +14 -5
- data/lib/apidiesel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99168d8b1698ce3a3154178081267af94fa768ef
|
4
|
+
data.tar.gz: 74e74db6ff6721aeef9966eb629d79961564dabe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc11532fbc03e1e71dee627e6b72fc0b8fbcc2c601b48fae335a62d672ee06d880790f4164c422a01d8f0837c4c56b13c786c40a2a8a4ac1b489b0c06cc0cb90
|
7
|
+
data.tar.gz: a4bd9177d8fb13a31ffc7983cad005c6a9a9ead3464ecf316ef6c916e3b53cf13aed6c2d1f09e905abd24edf7b3a434f981b1e7fde5b704ca9871de3d066fb08
|
data/lib/apidiesel/action.rb
CHANGED
@@ -162,21 +162,30 @@ module Apidiesel
|
|
162
162
|
Apidiesel::Request.new action: self, parameters: params
|
163
163
|
end
|
164
164
|
|
165
|
-
def process_response(
|
165
|
+
def process_response(response_data)
|
166
166
|
processed_result = {}
|
167
167
|
|
168
|
-
|
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
|
180
|
+
return response_data
|
172
181
|
end
|
173
182
|
|
174
183
|
self.class.response_filters.each do |filter|
|
175
|
-
|
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(
|
188
|
+
processed_result = filter.call(response_data, processed_result)
|
180
189
|
end
|
181
190
|
|
182
191
|
processed_result
|
data/lib/apidiesel/version.rb
CHANGED
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.
|
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
|
+
date: 2015-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|