circuit-api 0.0.5 → 0.0.6

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
  SHA256:
3
- metadata.gz: cabeb506fc51eb119a1547c9cf22b45cd874c578398dcc006b70b803a58df518
4
- data.tar.gz: 60cd2794cf18ca12d6a0d52950066d5b53b98e0d2e1502913f7c5773a6541374
3
+ metadata.gz: eb15fa96b8e646060129334e62e288aa47628ab8d136b5ccca0f12c5d01a58f7
4
+ data.tar.gz: 6f0175045cd1749da32b86e2717be3fa673bc3b7283dcea0b94c7e15bcda9ba4
5
5
  SHA512:
6
- metadata.gz: f7f7461f81ba542296d9c196e2edff79e19df6ec84494effd1282edbc1f957e038fc91a51dcfc6b08f2c457aca50cdd5e2bf35925aa4e2b46e831fec2c69096a
7
- data.tar.gz: 5f035f7de60299a2057e0506ae8904c1c0f7228edd6609f4284ef754d63ed28838d34d56a71deaeb3db4ca8e5090f11e4ea80dc5372dad02452b4a9854b82228
6
+ metadata.gz: 765cdcff0d7019ec8fd7a6dc9192d449826905b5487b6066da0fe3046473994a5e88193fb7e83111524ecd92e9603634098b95369409bee39c0f2fd83235dfc9
7
+ data.tar.gz: 88fb3b5bd00daa37b65488f4c722b4b2985cb07d3ce4373f02d58998bc107e9b566c26c829c1d7d053956a82dd136b1fea0d6b3cf5aa1b592b34b2ac67fdc6a4
@@ -6,7 +6,16 @@ module CircuitApi
6
6
  end
7
7
 
8
8
  def create_direct(participant)
9
- result = connection("#{api_resource}/direct", participant: participant).post
9
+ result = nil
10
+
11
+ begin
12
+ result = connection("#{api_resource}/direct", participant: participant).post
13
+ rescue CircuitApi::HttpError => e
14
+ raise unless e.error_code.to_i == 409
15
+
16
+ result = JSON.parse(e.error_body)
17
+ end
18
+
10
19
  response_to_object(result)
11
20
  end
12
21
  end
@@ -1,3 +1,3 @@
1
1
  module CircuitApi
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circuit-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Pochet