clientele 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clientele/resource.rb +3 -3
- data/lib/clientele/response.rb +1 -1
- data/lib/clientele/version.rb +1 -1
- 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: 5ac2a3d1b3ba87a31e5fbdec46e6bc0d2db13cc9
|
4
|
+
data.tar.gz: 4af4adace3ee0efb96bf4875e1140537e94790fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e07925ed6078e801f917b755632841f991849619e86c76d6509c937dbd2fcc91169e5091bad75c0da5ed7f21ab99bf83b5efbca2aae5e0aa8be89259724a2616
|
7
|
+
data.tar.gz: 20a38b8e284b4d693ab5d912864a3c23262fa8208090eb4bc1c3410c3cdfc6fb8f6daea94624bd70da79aec33b9f7ac6f4478a07e3b944dc3690e1dad805177b
|
data/lib/clientele/resource.rb
CHANGED
@@ -58,12 +58,12 @@ module Clientele
|
|
58
58
|
@nested_result_key || result_key
|
59
59
|
end
|
60
60
|
|
61
|
-
def build(data, client: nil)
|
62
|
-
|
61
|
+
def build(data, client: nil, klass: nil)
|
62
|
+
case (klass or data).kind_of? Array
|
63
63
|
data.map do |dataset|
|
64
64
|
build dataset, client: client
|
65
65
|
end
|
66
|
-
elsif data.kind_of? Hash and data.keys.map(&:to_s).include?
|
66
|
+
elsif (klass or data).kind_of? Hash and data.keys.map(&:to_s).include? result_key.to_s
|
67
67
|
build data.send method_name, client: client
|
68
68
|
else
|
69
69
|
new(data).tap do |instance|
|
data/lib/clientele/response.rb
CHANGED
data/lib/clientele/version.rb
CHANGED