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 +4 -4
- data/lib/coinsetter.rb +8 -12
- data/lib/coinsetter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ab79f08e90683339dee5c736916f6f4efaf2fa9
|
4
|
+
data.tar.gz: c82b2039b19e1033044e99a5cb24cc4d4cd7512b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a42017a792a73f1f810ac3fbfbe008451e8b0a97e232cd7abdf63bc85afbfde9b434074258b7608c3d3f3c5376a9fb343b8babb5f08ccb2fd667f0cdb4c9b4
|
7
|
+
data.tar.gz: 52c007f1cfaaeca5dc19317b1c7ce85f8159f9cdebde8272072424cdf5e49841489a6fdba5ef12248b2ba68c156917f1ba2e7c5935cf5d0384714f0cb5972b1c
|
data/lib/coinsetter.rb
CHANGED
@@ -38,7 +38,8 @@ module Coinsetter
|
|
38
38
|
configuration.username && configuration.password && configuration.ip_address
|
39
39
|
end
|
40
40
|
|
41
|
-
def self.
|
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.
|
84
|
-
|
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
|
data/lib/coinsetter/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|