coinsetter 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coinsetter/collection.rb +6 -5
- data/lib/coinsetter/net.rb +2 -2
- data/lib/coinsetter/version.rb +1 -1
- data/lib/coinsetter.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1b3961ef6fb2cb31a641bb0c1a0aea035f02089
|
4
|
+
data.tar.gz: 034991a6a4badef5649ec0beecc3d95d3ddaab3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97f76c1330c806810294ea2fdba554531d8af39cecfd9e4994c32976fa239f8da49dfaced144e59cd0de54a24938da7f06712b8c0a0a4fcd8fb1265c65c2c248
|
7
|
+
data.tar.gz: d87bd85039db16b02510640306a927c1c0a0ffe27c46f6af4bbf01f08537eae23b818184e5d7c5d1af8bdcca0eac0c84748fb1701f9edb7921b042b36903eaa6
|
@@ -43,11 +43,12 @@ module Coinsetter
|
|
43
43
|
|
44
44
|
private
|
45
45
|
def parse
|
46
|
-
@parsed ||=
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
@parsed ||=
|
47
|
+
if response.include? "\"requestStatus\":\"SUCCESS\""
|
48
|
+
Coinsetter::Helper.parse_object! response, model
|
49
|
+
else
|
50
|
+
Coinsetter::Helper.parse_message! response
|
51
|
+
end
|
51
52
|
end
|
52
53
|
|
53
54
|
def parse_collection
|
data/lib/coinsetter/net.rb
CHANGED
data/lib/coinsetter/version.rb
CHANGED
data/lib/coinsetter.rb
CHANGED
@@ -18,7 +18,6 @@ require "coinsetter/client_sessions"
|
|
18
18
|
require "coinsetter/client_session"
|
19
19
|
require "coinsetter/orders"
|
20
20
|
require "coinsetter/order"
|
21
|
-
require "coinsetter/order"
|
22
21
|
|
23
22
|
String.send(:include, ActiveSupport::Inflector)
|
24
23
|
|
@@ -40,18 +39,19 @@ module Coinsetter
|
|
40
39
|
end
|
41
40
|
|
42
41
|
def self.with_session
|
43
|
-
session =
|
42
|
+
session = ClientSessions.new
|
44
43
|
client_session = session.create(credentials)
|
45
44
|
|
46
|
-
if client_session.kind_of?
|
45
|
+
if client_session.kind_of? ClientSession
|
47
46
|
yield client_session if block_given?
|
47
|
+
client_session.destroy!
|
48
|
+
else
|
49
|
+
client_session
|
48
50
|
end
|
49
|
-
|
50
|
-
client_session.destroy!
|
51
51
|
end
|
52
52
|
|
53
53
|
def self.orders
|
54
|
-
@@orders ||=
|
54
|
+
@@orders ||= Orders.new
|
55
55
|
end
|
56
56
|
|
57
57
|
def self.add_order(side='BUY', options={})
|
@@ -70,7 +70,7 @@ module Coinsetter
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def self.sell_order(amount, price, account_uuid, options={})
|
73
|
-
add_order('
|
73
|
+
add_order('SELL', options.merge(required_params(amount, price, account_uuid)))
|
74
74
|
end
|
75
75
|
|
76
76
|
def self.default_options
|