Class: MtgoxClient

Inherits:
Object
  • Object
show all
Defined in:
lib/mtgox-ruby.rb

Constant Summary collapse

MTGOX_API_URL =
"https://mtgox.com/code/data/"

Instance Attribute Summary collapse

Instance Method Summary collapse

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_urlObject

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_balanceObject



35
36
37
# File 'lib/mtgox-ruby.rb', line 35

def current_balance
  raise "implement me"
end

#market_depthObject



23
24
25
# File 'lib/mtgox-ruby.rb', line 23

def market_depth
  raise "implement me"
end

#open_ordersObject



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_tradesObject



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_dataObject



19
20
21
# File 'lib/mtgox-ruby.rb', line 19

def ticker_data
  raise "implement me"
end