clientele 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clientele/api.rb +6 -5
- data/lib/clientele/resource.rb +8 -0
- 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: 42d05ad46528a07ab88673413c5bdb66dfda81b3
|
4
|
+
data.tar.gz: 0dfc3af744108a98ce482fc6b243eabd3c4ab9c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79ce0d0cfbe01da3b297422d36c89980aebafa02390d86c4b34a30d050d991628f6ac8d2b5ca9592ecd3c9b37c8bc9e054eea5eb9760e25a9bf098b7b8909868
|
7
|
+
data.tar.gz: c631f93a29c1d4751b90793ee948962d652ac413490adea379995e24abfe9ee981230bf75726378caed917d19dd141343acac71fd2e4e61e50e8042c12aa1ac9
|
data/lib/clientele/api.rb
CHANGED
@@ -49,7 +49,8 @@ module Clientele
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def reconfigure_global_client!(opts={})
|
52
|
-
reset_global_client!
|
52
|
+
reset_global_client!
|
53
|
+
client(opts)
|
53
54
|
end
|
54
55
|
|
55
56
|
private
|
@@ -87,10 +88,10 @@ module Clientele
|
|
87
88
|
end
|
88
89
|
|
89
90
|
def method_missing(method_name, *args, &block)
|
90
|
-
if resources.keys.include? method_name
|
91
|
-
RequestBuilder.new(resources[method_name], client: self)
|
92
|
-
elsif Request::VERBS.include? method_name
|
93
|
-
RequestBuilder.new(Request.send(method_name, *args), client: self)
|
91
|
+
if resources.keys.include? method_name.to_s
|
92
|
+
RequestBuilder.new(resources[method_name.to_s], client: self)
|
93
|
+
elsif Request::VERBS.include? method_name.to_s
|
94
|
+
RequestBuilder.new(Request.send(method_name.to_s, *args), client: self)
|
94
95
|
else; super; end
|
95
96
|
end
|
96
97
|
|
data/lib/clientele/resource.rb
CHANGED
@@ -50,6 +50,14 @@ module Clientele
|
|
50
50
|
@method_name || path
|
51
51
|
end
|
52
52
|
|
53
|
+
def result_key
|
54
|
+
@result_key || method_name
|
55
|
+
end
|
56
|
+
|
57
|
+
def nested_result_key
|
58
|
+
@nested_result_key || result_key
|
59
|
+
e
|
60
|
+
|
53
61
|
def build(data, client: nil)
|
54
62
|
if data.kind_of? Array
|
55
63
|
data.map do |dataset|
|
data/lib/clientele/version.rb
CHANGED