Class: MtgoxClient
- Inherits:
-
Object
- Object
- MtgoxClient
- Defined in:
- lib/mtgox-ruby.rb
Constant Summary collapse
- MTGOX_API_URL =
"https://mtgox.com/code/data/"
Instance Attribute Summary collapse
-
#api_url ⇒ Object
Returns the value of attribute api_url.
Instance Method Summary collapse
- #cancel_order(order) ⇒ Object
- #current_balance ⇒ Object
-
#initialize(url = nil) ⇒ MtgoxClient
constructor
A new instance of MtgoxClient.
- #market_depth ⇒ Object
- #open_orders ⇒ Object
- #place_order(order) ⇒ Object
- #recent_trades ⇒ Object
- #send_bitcoin(amount, bitcoin_address) ⇒ Object
- #ticker_data ⇒ Object
Constructor Details
#initialize(url = nil) ⇒ MtgoxClient
Returns a new instance of MtgoxClient.
15 16 17 |
# File 'lib/mtgox-ruby.rb', line 15 def initialize(url=nil) self.api_url = url || MTGOX_API_URL end |
Instance Attribute Details
#api_url ⇒ Object
Returns the value of attribute api_url.
13 14 15 |
# File 'lib/mtgox-ruby.rb', line 13 def api_url @api_url end |
Instance Method Details
#cancel_order(order) ⇒ Object
43 44 45 |
# File 'lib/mtgox-ruby.rb', line 43 def cancel_order(order) raise "implement me" end |
#current_balance ⇒ Object
35 36 37 |
# File 'lib/mtgox-ruby.rb', line 35 def current_balance raise "implement me" end |
#market_depth ⇒ Object
23 24 25 |
# File 'lib/mtgox-ruby.rb', line 23 def market_depth raise "implement me" end |
#open_orders ⇒ Object
39 40 41 |
# File 'lib/mtgox-ruby.rb', line 39 def open_orders raise "implement me" end |
#place_order(order) ⇒ Object
47 48 49 |
# File 'lib/mtgox-ruby.rb', line 47 def place_order(order) raise "implement me" end |
#recent_trades ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/mtgox-ruby.rb', line 27 def recent_trades json = JSON.parse(submit_request('getTrades.php')) orders = json.map do |trade_json| MtgoxOrder.from_json(trade_json) end return orders end |
#send_bitcoin(amount, bitcoin_address) ⇒ Object
51 52 53 |
# File 'lib/mtgox-ruby.rb', line 51 def send_bitcoin(amount, bitcoin_address) raise "implement me" end |
#ticker_data ⇒ Object
19 20 21 |
# File 'lib/mtgox-ruby.rb', line 19 def ticker_data raise "implement me" end |