coinsetter 0.0.8 → 0.0.9

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: afeffb31dcc3d845af188921bbf992e29c673bc7
4
- data.tar.gz: 72cfe313d63a7acea8d723f6cc4e50af18c64327
3
+ metadata.gz: 2ab79f08e90683339dee5c736916f6f4efaf2fa9
4
+ data.tar.gz: c82b2039b19e1033044e99a5cb24cc4d4cd7512b
5
5
  SHA512:
6
- metadata.gz: ffccf55b06cb5a9fbf1180783c687e806707d25b912e9412783279c032293bffa2ef24a17e47b7838f5738a9128aa283a6ad4555da91bd79dc196acaba0789fd
7
- data.tar.gz: fee5fff28bac73aadd6f8b4df6694b62addacfe252c0d1541389ea92f20f2542e535fbc7f680db04e28b6d7667d690e42e594c3e93d988592446446f63ef8d5f
6
+ metadata.gz: 53a42017a792a73f1f810ac3fbfbe008451e8b0a97e232cd7abdf63bc85afbfde9b434074258b7608c3d3f3c5376a9fb343b8babb5f08ccb2fd667f0cdb4c9b4
7
+ data.tar.gz: 52c007f1cfaaeca5dc19317b1c7ce85f8159f9cdebde8272072424cdf5e49841489a6fdba5ef12248b2ba68c156917f1ba2e7c5935cf5d0384714f0cb5972b1c
@@ -38,7 +38,8 @@ module Coinsetter
38
38
  configuration.username && configuration.password && configuration.ip_address
39
39
  end
40
40
 
41
- def self.with_session
41
+ def self.with_new_session
42
+ destroy_client_session!
42
43
  if client_session.kind_of? ClientSession
43
44
  yield client_session if block_given?
44
45
  else
@@ -56,7 +57,11 @@ module Coinsetter
56
57
  end
57
58
 
58
59
  def self.destroy_client_session!
60
+ begin
59
61
  client_session.destroy!
62
+ rescue e
63
+ # TODO: Add error responses.
64
+ end
60
65
  @client_session = nil
61
66
  end
62
67
 
@@ -80,22 +85,13 @@ module Coinsetter
80
85
  orders.get(order_uuid)
81
86
  end
82
87
 
83
- def self.add_order_with_new_session(side='BUY', options={})
84
- order = with_session do |client_session|
88
+ def self.add_order(side='BUY', options={})
89
+ with_new_session do |client_session|
85
90
  params = default_options.merge(options)
86
91
  params.merge!(side: side,
87
92
  customerUuid: client_session.customer_uuid)
88
93
  orders.create(params)
89
94
  end
90
-
91
- order.kind_of?(Order) ? Coinsetter.get_order(order.uuid) : nil
92
- end
93
-
94
- def self.add_order(side='BUY', options={})
95
- params = default_options.merge(options)
96
- params.merge!(side: side,
97
- customerUuid: client_session.customer_uuid)
98
- orders.create(params)
99
95
  end
100
96
 
101
97
  # Required Order Params
@@ -1,3 +1,3 @@
1
1
  module Coinsetter
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinsetter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Galaviz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-08 00:00:00.000000000 Z
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler