cb-api 12.3.3 → 12.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@ module Cb
17
17
  def call_api(request)
18
18
  http_wrapper.execute_http_request(
19
19
  request.http_method,
20
+ request.base_uri,
20
21
  request.endpoint_uri,
21
22
  {
22
23
  query: request.query,
@@ -9,6 +9,10 @@ module Cb
9
9
  @args = argument_hash
10
10
  end
11
11
 
12
+ def base_uri
13
+ Cb.config.base_uri
14
+ end
15
+
12
16
  def endpoint_uri
13
17
  raise NotImplementedError.new __method__
14
18
  end
@@ -29,23 +29,23 @@ module Cb
29
29
  end
30
30
 
31
31
  def cb_get(path, options={}, &block)
32
- execute_http_request(:get, path, options, &block)
32
+ execute_http_request(:get, nil, path, options, &block)
33
33
  end
34
34
 
35
35
  def cb_post(path, options={}, &block)
36
- execute_http_request(:post, path, options, &block)
36
+ execute_http_request(:post, nil, path, options, &block)
37
37
  end
38
38
 
39
39
  def cb_put(path, options={}, &block)
40
- execute_http_request(:put, path, options, &block)
40
+ execute_http_request(:put, nil, path, options, &block)
41
41
  end
42
42
 
43
43
  def cb_delete(path, options={}, &block)
44
- execute_http_request(:delete, path, options, &block)
44
+ execute_http_request(:delete, nil, path, options, &block)
45
45
  end
46
46
 
47
- def execute_http_request(http_method, path, options={}, &block)
48
- self.class.base_uri Cb.configuration.base_uri
47
+ def execute_http_request(http_method, uri, path, options={}, &block)
48
+ self.class.base_uri(uri || Cb.configuration.base_uri)
49
49
  cb_event(:"cb_#{http_method.to_s}_before", path, options, nil, &block)
50
50
  response = self.class.method(http_method).call(path, options)
51
51
  cb_event(:"cb_#{http_method.to_s}_after", path, options, response, &block)
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '12.3.3'
2
+ VERSION = '12.4.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.3.3
4
+ version: 12.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-25 00:00:00.000000000 Z
12
+ date: 2014-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty