Class: MtGox::Client

Inherits:
Object
  • Object
show all
Includes:
Connection, Request
Defined in:
lib/mtgox/client.rb

Instance Method Summary collapse

Methods included from Request

#get

Instance Method Details

#asksArray<Numeric>

Fetch open asks

Examples:

MtGox.asks

Returns:

  • (Array<Numeric>)


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

def asks
  get('/code/data/getDepth.php')['asks']
end

#bidsArray<Numeric>

Fetch open bids

Examples:

MtGox.bids

Returns:

  • (Array<Numeric>)


32
33
34
# File 'lib/mtgox/client.rb', line 32

def bids
  get('/code/data/getDepth.php')['bids']
end

#tickerHashie::Rash

Fetch the latest ticker data

Examples:

MtGox.ticker

Returns:

  • (Hashie::Rash)


14
15
16
# File 'lib/mtgox/client.rb', line 14

def ticker
  get('/code/data/ticker.php')['ticker']
end

#tradesArray<Hashie::Rash>

Fetch recent trades

Examples:

MtGox.trades

Returns:

  • (Array<Hashie::Rash>)


41
42
43
# File 'lib/mtgox/client.rb', line 41

def trades
  get('/code/data/getTrades.php').each{|t| t['date'] = Time.at(t['date'])}
end