Module: Btc38
- Defined in:
- lib/btc38.rb,
lib/btc38/version.rb
Defined Under Namespace
Classes: Configuration
Constant Summary collapse
- VERSION =
"0.1.1"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
- .balances ⇒ Object
- .cancel_order(mk_type, order_id, coinname) ⇒ Object
- .depth(c, mk_type) ⇒ Object
- .order_list(mk_type, coinname) ⇒ Object
- .setup {|configuration| ... } ⇒ Object
- .submit_order(type, mk_type, price, amount, coinname) ⇒ Object
- .ticker(c = 'all', mk_type = 'cny') ⇒ Object
- .trade_list(mk_type, coinname) ⇒ Object
- .trades(c, mk_type, options = {}) ⇒ Object
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
8 9 10 |
# File 'lib/btc38.rb', line 8 def configuration @configuration end |
Class Method Details
.balances ⇒ Object
38 39 40 |
# File 'lib/btc38.rb', line 38 def self.balances post 'getMyBalance' end |
.cancel_order(mk_type, order_id, coinname) ⇒ Object
46 47 48 |
# File 'lib/btc38.rb', line 46 def self.cancel_order(mk_type, order_id, coinname) post 'cancelOrder', mk_type: mk_type, order_id: order_id, coinname: coinname end |
.depth(c, mk_type) ⇒ Object
30 31 32 |
# File 'lib/btc38.rb', line 30 def self.depth(c, mk_type) get 'depth', c: c, mk_type: mk_type end |
.order_list(mk_type, coinname) ⇒ Object
50 51 52 |
# File 'lib/btc38.rb', line 50 def self.order_list(mk_type, coinname) post 'getOrderList', mk_type: mk_type, coinname: coinname end |
.setup {|configuration| ... } ⇒ Object
11 12 13 14 |
# File 'lib/btc38.rb', line 11 def self.setup @configuration ||= Configuration.new yield( configuration ) end |
.submit_order(type, mk_type, price, amount, coinname) ⇒ Object
42 43 44 |
# File 'lib/btc38.rb', line 42 def self.submit_order(type, mk_type, price, amount, coinname) post 'submitOrder', type: type, mk_type: mk_type, price: price, amount: amount, coinname: coinname end |
.ticker(c = 'all', mk_type = 'cny') ⇒ Object
26 27 28 |
# File 'lib/btc38.rb', line 26 def self.ticker(c='all', mk_type='cny') get 'ticker', c: c, mk_type: mk_type end |
.trade_list(mk_type, coinname) ⇒ Object
54 55 56 |
# File 'lib/btc38.rb', line 54 def self.trade_list(mk_type, coinname) post 'getMyTradeList', mk_type: mk_type, coinname: coinname end |
.trades(c, mk_type, options = {}) ⇒ Object
34 35 36 |
# File 'lib/btc38.rb', line 34 def self.trades(c, mk_type, = {}) get 'trades', .merge({c: c, mk_type: mk_type}) end |