clientele 0.3.11 → 0.3.12
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 +5 -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: 8a9de556f76af020598d75acc6e88342b1883ff3
|
4
|
+
data.tar.gz: 49ca10119b63bd8f6b2d8fdf193fa0feaac719aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 854171f71a536110e927c6d315e2c11d9f563c32fa1ef3e3606b2b164fa2a7ba173f2ba82790927192d2ab7028dfe8aebd1d28efbc8a30e38b99e928b317294f
|
7
|
+
data.tar.gz: 48c490df9685c2499973ec329f2450bc381fd66b77c058456a366145f985c0b323f64fa58c4983f0b6123e69c1813bf4a100ee0508feb9b1bf221e4535114227
|
data/lib/clientele/resource.rb
CHANGED
@@ -54,12 +54,16 @@ module Clientele
|
|
54
54
|
@result_key || method_name.to_s.singularize
|
55
55
|
end
|
56
56
|
|
57
|
+
def results_key
|
58
|
+
@results_key || (@result_key || method_name).to_s.pluralize
|
59
|
+
end
|
60
|
+
|
57
61
|
def result(data)
|
58
62
|
data[result_key]
|
59
63
|
end
|
60
64
|
|
61
65
|
def results(data)
|
62
|
-
|
66
|
+
data[results_key] if data[results_key] and data[results_key].kind_of?(Array)
|
63
67
|
end
|
64
68
|
|
65
69
|
def build(data, client: nil, response: nil)
|
data/lib/clientele/version.rb
CHANGED