class BitcoinTicker::Bitcurex
Constants
- SUPPORTED_BITCURRENCIES
- SUPPORTED_CURRENCIES
Public Class Methods
link()
click to toggle source
# File lib/bitcoin_ticker/exchanges/bitcurex.rb, line 12 def self.link "https://bitcurex.com/" end
name()
click to toggle source
# File lib/bitcoin_ticker/exchanges/bitcurex.rb, line 8 def self.name "Bitcurex" end
Private Class Methods
get_rate()
click to toggle source
# File lib/bitcoin_ticker/exchanges/bitcurex.rb, line 21 def self.get_rate client = BitcoinTicker::Client.new(link) response = client.get(ticker_endpoint) BitcoinTicker::Rate.new(@bitcurrency, @currency, normalize_api_response(response[:body])) end
normalize_api_response(hash)
click to toggle source
# File lib/bitcoin_ticker/exchanges/bitcurex.rb, line 30 def self.normalize_api_response hash { last: hash[:last_tx_price_h], high: hash[:highest_tx_price_h], low: hash[:lowest_tx_price_h], vwap: nil, volume: hash[:total_volume_h], bid: hash[:best_bid_h], ask: hash[:best_ask_h] } end
ticker_endpoint()
click to toggle source
# File lib/bitcoin_ticker/exchanges/bitcurex.rb, line 16 def self.ticker_endpoint "/api/#{@currency}/ticker.json" end