class BitcoinTicker::Btce
Constants
- SUPPORTED_BITCURRENCIES
- SUPPORTED_CURRENCIES
Public Class Methods
link()
click to toggle source
# File lib/bitcoin_ticker/exchanges/btce.rb, line 12 def self.link "https://btc-e.com/" end
name()
click to toggle source
# File lib/bitcoin_ticker/exchanges/btce.rb, line 8 def self.name "BTC-e" end
Private Class Methods
get_rate()
click to toggle source
# File lib/bitcoin_ticker/exchanges/btce.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/btce.rb, line 30 def self.normalize_api_response hash pair_name_sym = "#{@bitcurrency}_#{@currency}".to_sym { last: hash[pair_name_sym][:last], high: hash[pair_name_sym][:high], low: hash[pair_name_sym][:low], vwap: nil, volume: hash[pair_name_sym][:vol], bid: hash[pair_name_sym][:buy], ask: hash[pair_name_sym][:sell] } end
ticker_endpoint()
click to toggle source
# File lib/bitcoin_ticker/exchanges/btce.rb, line 16 def self.ticker_endpoint "/api/3/ticker/#{@bitcurrency}_#{@currency}" end