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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45e24ef28f790a89e16cb53f0c44c4fc9176b539
4
- data.tar.gz: 5b257efae30faacb896f40d135fa19bd085ff7a8
3
+ metadata.gz: 42d05ad46528a07ab88673413c5bdb66dfda81b3
4
+ data.tar.gz: 0dfc3af744108a98ce482fc6b243eabd3c4ab9c8
5
5
  SHA512:
6
- metadata.gz: 0dde13065d7d012d0ab9650baaaba73379bba2572629a97ee3f26efff0f3292f7f99c6fa4dfe8ce66b9f450fed2cff2e5c01fad6e333686ae4a82390c9f1ed88
7
- data.tar.gz: b2889a68bc5cc46834faa32fcd40cf2477f9882c1855648c4096f4ce4c3e3763ceb4d84456ac40a0bbc38b303d8e982fdc92c0c50ca111c79236f68500db45b6
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! and client(opts)
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
 
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module Clientele
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clientele
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Keele