Class: Bter::Trade
Constant Summary collapse
- METHODS =
['getfunds', 'orderlist', 'getorder', 'cancelorder', 'mytrades']
Constants included from Request
Request::PUBLIC_URL, Request::TRADE_URL
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
-
#buy(pair, amount, rate = nil) ⇒ Object
abstract the trade to buy and sell.
-
#logging(log) ⇒ Object
soon to be removed.
- #sell(pair, amount, rate = nil) ⇒ Object
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/bter/trading.rb', line 7 def key @key end |
#secret ⇒ Object
Returns the value of attribute secret.
7 8 9 |
# File 'lib/bter/trading.rb', line 7 def secret @secret end |
Instance Method Details
#buy(pair, amount, rate = nil) ⇒ Object
abstract the trade to buy and sell
22 23 24 25 |
# File 'lib/bter/trading.rb', line 22 def buy(pair, amount, rate=nil) rate ||= get_rate(pair) trade({:pair => pair, :type => "BUY", :rate => rate, :amount => amount}) end |
#logging(log) ⇒ Object
soon to be removed
40 41 42 |
# File 'lib/bter/trading.rb', line 40 def logging(log) raise "Logger is no longer available , please remove it" end |
#sell(pair, amount, rate = nil) ⇒ Object
27 28 29 30 |
# File 'lib/bter/trading.rb', line 27 def sell(pair, amount, rate=nil) rate ||= get_rate(pair) trade({:pair => pair, :type => "SELL", :rate => rate, :amount => amount}) end |