Sha256: 301a1b232ce8545c536b31299eb139f90c3919b535b5f6c11256a022595583f9
Contents?: true
Size: 436 Bytes
Versions: 6
Compression:
Stored size: 436 Bytes
Contents
module CurrencyRate class HuobiAdapter < Adapter FETCH_URL = { "BTC_CNY" => "http://api.huobi.com/staticmarket/ticker_btc_json.js", "LTC_CNY" => "http://api.huobi.com/staticmarket/ticker_ltc_json.js" } def normalize(data) return nil unless super data.reduce({}) do |result, (pair, value)| result[pair] = BigDecimal(value["ticker"]["last"].to_s) result end end end end
Version data entries
6 entries across 6 versions & 1 rubygems