bloom_remit_client 0.5.0 → 0.6.0

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: 7aa72dd929a84719317015b974e91bd7a94cf50c
4
- data.tar.gz: d46e17cc17b58475aace9fa894dbe77f5f2a1d20
3
+ metadata.gz: 95d75896514499a9ed04e5ce11fd4f456669e518
4
+ data.tar.gz: b045e5dd7adf94cc9f8932d2c1961fa16f0fa907
5
5
  SHA512:
6
- metadata.gz: 198399971aef5c0fd6ce5edd5ecebb8765930e6634af69241802a88bee378ccb2e17e33cdff39d4daedd1c4ab92022c1d73c413a88070359c7425a506cfb52eb
7
- data.tar.gz: 28e0e4d2492a0b6c1d98eb837c08fcbda124a7d5df36f35d427ad0a84839dd5760131066c4432ee1285c85dedc04d37c623f01225f2cb5f6f0618242f7400595
6
+ metadata.gz: 4531d4b578608cbdb0cc6c080ef2963a67d21bde7c24091a8763f04f66030d261a52c1f5eb8df2e548fc873fb4cbb705edad1bd547f2c43dd9306ff666ef256b
7
+ data.tar.gz: b6ec98c01559adb3bc7aea1242ec4cd7c5bd5b9c23752374e25d783fc4570218c0d14cba0de49c977d279fb7a537b59d8d642dba396543fc793b1104b24920f9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [0.6.0] - 2016-09-15
6
+ ### Changed
7
+ - Default to staging URL
8
+
9
+ ### Fixed
10
+ - Make more threadsafe by passing host into client instantiation
11
+
5
12
  ## [0.5.0] - 2016-09-15
6
13
  ### Changed
7
14
  - Structure of files to more easily add new endpoints
data/README.md CHANGED
@@ -34,7 +34,7 @@ To make testing easier, you may `require 'bloom_remit_client/factories'` in your
34
34
 
35
35
  ## Contributing
36
36
 
37
- Bug reports and pull requests are welcome on GitHub at https://github.com/imacchiato/bloom_remit_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
37
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/imacchiato/bloom_remit_client-ruby). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
38
38
 
39
39
  ## License
40
40
 
@@ -7,8 +7,9 @@ module BloomRemitClient
7
7
  attribute :api_token, String
8
8
  attribute :api_secret, String
9
9
  attribute :agent_id, String
10
+ attribute :host, String
10
11
 
11
- validates :api_token, :api_secret, presence: true
12
+ validates :api_token, :api_secret, :host, presence: true
12
13
 
13
14
  # GET
14
15
  # /api/v1/partners/:api_token/credits
@@ -86,7 +87,7 @@ module BloomRemitClient
86
87
 
87
88
  # Should overwrite any other `:api_token`, `:api_secret`
88
89
  def access_params
89
- @access_params ||= attributes.slice(:api_token, :api_secret)
90
+ @access_params ||= attributes.slice(:host, :api_token, :api_secret)
90
91
  end
91
92
 
92
93
  def default_params
@@ -6,8 +6,9 @@ module BloomRemitClient
6
6
  base.class_eval do
7
7
  attribute :api_token, String
8
8
  attribute :api_secret, String
9
+ attribute :host, String
9
10
 
10
- validates :api_token, :api_secret, presence: true
11
+ validates :api_token, :api_secret, :host, presence: true
11
12
  end
12
13
  end
13
14
  end
@@ -15,7 +15,7 @@ module BloomRemitClient
15
15
  type: type,
16
16
  body: body,
17
17
  url: {
18
- host: ::BloomRemitClient.host,
18
+ host: host,
19
19
  path: path,
20
20
  query_params: query_params
21
21
  }
@@ -1,3 +1,3 @@
1
1
  module BloomRemitClient
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -42,15 +42,18 @@ module BloomRemitClient
42
42
  attr_accessor :sandbox
43
43
  attr_writer :host
44
44
 
45
- def new(*args)
46
- client = Client.new(*args)
45
+ def new(args)
46
+ client_args = args
47
+ client_args[:host] ||= self.host
48
+ client = Client.new(client_args)
47
49
  raise ArgumentError, client.errors.full_messages if client.invalid?
48
50
  client
49
51
  end
50
52
 
51
53
  def host
52
54
  return @host if @host
53
- sandbox ? STAGING : PRODUCTION
55
+ return STAGING if sandbox.nil? || sandbox
56
+ PRODUCTION
54
57
  end
55
58
  end
56
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bloom_remit_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag