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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fe68bc71133c3d15fafc53413833482ae536480
4
- data.tar.gz: 3ca776bc4aa124e4b2280a42f90da8b14a22a022
3
+ metadata.gz: a1b3961ef6fb2cb31a641bb0c1a0aea035f02089
4
+ data.tar.gz: 034991a6a4badef5649ec0beecc3d95d3ddaab3d
5
5
  SHA512:
6
- metadata.gz: 36b04912f2e2780b084f7400b3db2be70e627c154e03e07fd8caee57bfb7742c75ce1980fc509f3b9a7acf28b235b6d980030ac5c662911db26bc54f900b3559
7
- data.tar.gz: e8f373a3166a59780f4ee7e7ff5cbe1ff3ddd3b0a8648b56af8dd053cf1cddf0aeb4c554195cf8b7fb82516886f0c9a80022b10585d79a00ee098b210f839691
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 ||= if response["requestStatus"] == "SUCCESS"
47
- Coinsetter::Helper.parse_object! response, model
48
- else
49
- Coinsetter::Helper.parse_message! response
50
- end
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
@@ -1,7 +1,7 @@
1
- module Bitstamp
1
+ module Coinsetter
2
2
  module Net
3
3
  def self.uri(path)
4
- return "#{Bitstamp.uri}#{path}"
4
+ return "#{Coinsetter.configuration.uri}#{path}"
5
5
  end
6
6
 
7
7
  def self.get(path, headers={})
@@ -1,3 +1,3 @@
1
1
  module Coinsetter
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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 = Coinsetter::ClientSessions.new
42
+ session = ClientSessions.new
44
43
  client_session = session.create(credentials)
45
44
 
46
- if client_session.kind_of? Coinsetter::ClientSession
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 ||= Coinsetter::Orders.new
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('BUY', options.merge(required_params(amount, price, account_uuid)))
73
+ add_order('SELL', options.merge(required_params(amount, price, account_uuid)))
74
74
  end
75
75
 
76
76
  def self.default_options
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinsetter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Galaviz