beyonic 0.0.13 → 0.0.14

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: 421843c5cc0479fe70ac2de8093dc013674abbeb
4
- data.tar.gz: ac3aaf56e63d2f401668f95b97956209bb2cfd2e
3
+ metadata.gz: a72179f3fcb9aa8be02c014fd83031ec876680bb
4
+ data.tar.gz: 6416f40c6ce6363325b53b71abf3f7e6f0874a1c
5
5
  SHA512:
6
- metadata.gz: 1954dd8abab24fb4f1adad6a5fccdc7983a5f2faf834acb2eafb6e8bd1a2a63d70956fd92a24ce26aad535dab0f7797d38b81ee7199d0590d08254c3bb60bffa
7
- data.tar.gz: eec32a9cb4ccc22219da555a551d32558fe241658aa42469b466319f335d782a851568dfbd1eb743ac66d42ca7cf75bfdbe963a4bcd23eecff5cd0cab5e3d4f2
6
+ metadata.gz: e2c83dcc1320a27fba5606c3f146167d4c7200951f13226fc40e8b3075765fb79dd8057806a98e2a1c9ba5101b09f166eca60dda2acdd462d37bde42d1817dfa
7
+ data.tar.gz: a163744ca4ee23d4369ce166dbebb30b2e917f14a095a1f7059e1c1cbe77dc10416fb25412304617fe890a4f3ca1bc8008d5d7582a8e5bd9badccb37dcb8315c
@@ -50,4 +50,8 @@ To release a new version of the gem:
50
50
  - Increment the version in lib/beyonic/version.rb
51
51
  - Push all code
52
52
  - Build the gem with ```gem build beyonic.gemspec```
53
- - Push the gem to rubygems with ```gem push beyonic-X.X.X.gem```
53
+ - Push the gem to rubygems with ```gem push beyonic-X.X.X.gem```
54
+
55
+ ## Changelog
56
+
57
+ 0.0.14 - Added Network and Currency APIs and the ability to set the Duplicate-Check-Key for each create() and update() request.
@@ -8,7 +8,7 @@ module Beyonic::AbstractApi
8
8
  @endpoint_url = Beyonic.endpoint_base + resource
9
9
  end
10
10
 
11
- def create(payload = {})
11
+ def create(payload = {}, header_overrides = {})
12
12
  # transform metadata from hash notation to dot notation
13
13
  if (payload.has_key?:metadata) && (!payload[:metadata].empty?)
14
14
  payload[:metadata].each do |key, value|
@@ -16,7 +16,7 @@ module Beyonic::AbstractApi
16
16
  end
17
17
  payload.delete:metadata
18
18
  end
19
- resp = RestClient.post(@endpoint_url, payload, headers)
19
+ resp = RestClient.post(@endpoint_url, payload, headers(header_overrides))
20
20
  self.new(Oj.load(resp))
21
21
  rescue RestClient::BadRequest => e
22
22
  raise ApiError.new(Oj.load(e.response.body))
@@ -39,8 +39,8 @@ module Beyonic::AbstractApi
39
39
  self.new(Oj.load(resp))
40
40
  end
41
41
 
42
- def update(id, payload)
43
- resp = RestClient.patch("#{@endpoint_url}/#{id}", payload, headers)
42
+ def update(id, payload, header_overrides = {})
43
+ resp = RestClient.patch("#{@endpoint_url}/#{id}", payload, headers(header_overrides))
44
44
  self.new(Oj.load(resp))
45
45
  rescue RestClient::BadRequest => e
46
46
  raise ApiError.new(Oj.load(e.response.body))
@@ -53,12 +53,13 @@ module Beyonic::AbstractApi
53
53
 
54
54
  private
55
55
 
56
- def headers
56
+ def headers(header_overrides = {})
57
57
  headers_hash = {}
58
58
  headers_hash.merge!({"Authorization" => "Token #{Beyonic.api_key}"}) if Beyonic.api_key
59
59
  headers_hash.merge!({"Beyonic-Version" => Beyonic.api_version}) if Beyonic.api_version
60
60
  headers_hash.merge!({"Beyonic-Client" => "Ruby"})
61
61
  headers_hash.merge!({"Beyonic-Client-Version" => Beyonic::VERSION})
62
+ headers_hash.merge!(header_overrides)
62
63
  headers_hash
63
64
  end
64
65
 
@@ -0,0 +1,5 @@
1
+ require 'ostruct'
2
+ class Beyonic::Currency < OpenStruct
3
+ include Beyonic::AbstractApi
4
+ set_endpoint_resource "currencies"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'ostruct'
2
+ class Beyonic::Network < OpenStruct
3
+ include Beyonic::AbstractApi
4
+ set_endpoint_resource "networks"
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Beyonic
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyonic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg German
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-07 00:00:00.000000000 Z
12
+ date: 2019-07-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -167,6 +167,8 @@ files:
167
167
  - lib/beyonic/collection.rb
168
168
  - lib/beyonic/collection_request.rb
169
169
  - lib/beyonic/contact.rb
170
+ - lib/beyonic/currency.rb
171
+ - lib/beyonic/network.rb
170
172
  - lib/beyonic/payment.rb
171
173
  - lib/beyonic/transaction.rb
172
174
  - lib/beyonic/version.rb