Sha256: 533629b6deb1d5562b69af201c02c3a0ee410205e929c3670abc27dceb07e568

Contents?: true

Size: 418 Bytes

Versions: 3

Compression:

Stored size: 418 Bytes

Contents

module CurrencyRate
  class BTCChinaAdapter < CryptoAdapter

    FETCH_URL = 'https://data.btcchina.com/data/ticker'
    DEFAULT_CURRENCIES = ["CNY", "BTC"]
    SUPPORTED_CRYPTO_CURRENCIES = ["BTC"]

    def rate_for(from,to)
      super
      rate = rate_to_f(@rates['ticker'] && @rates['ticker']['last'])
      invert_rate(from,to,rate)
    end

    def supported_currency_pairs
      ["BTC/CNY"]
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
currency-rate-0.4.1 lib/crypto_adapters/btcchina_adapter.rb
currency-rate-0.4.0 lib/crypto_adapters/btcchina_adapter.rb
currency-rate-0.3.9 lib/crypto_adapters/btcchina_adapter.rb