class Bitfinex::Ticker

Public Class Methods

new(currency_exchange) click to toggle source
# File lib/bitfinex.rb, line 11
def initialize currency_exchange
  ticker_url = BASE_URL + '/pubticker/' + currency_exchange
  @ticker = HTTParty.get(ticker_url).symbolize_keys
end

Public Instance Methods

average() click to toggle source
# File lib/bitfinex.rb, line 18
def average; @ticker[:mid].to_f; end
buy() click to toggle source
# File lib/bitfinex.rb, line 20
def buy; @ticker[:ask].to_f; end
high() click to toggle source
# File lib/bitfinex.rb, line 16
def high; @ticker[:high].to_f; end
last() click to toggle source
# File lib/bitfinex.rb, line 19
def last; @ticker[:last_price].to_f; end
low() click to toggle source
# File lib/bitfinex.rb, line 17
def low; @ticker[:low].to_f; end
sell() click to toggle source
# File lib/bitfinex.rb, line 21
def sell; @ticker[:bid].to_f; end
volume() click to toggle source
# File lib/bitfinex.rb, line 22
def volume; @ticker[:volume].to_f; end