lib/mcoin/market/bitfinex.rb in mcoin-0.5.2 vs lib/mcoin/market/bitfinex.rb in mcoin-0.6.0
- old
+ new
@@ -4,19 +4,20 @@
module Market
# :nodoc:
class Bitfinex < Base
ENDPOINT = 'https://api.bitfinex.com/v1/pubticker/%<type>s%<currency>s'
- def to_ticker
- fetch
+ private
+
+ def build_ticker(pair, response)
Data::Ticker.new(
:Bitfinex,
- @type, @currency,
- last: @data['last_price'],
- ask: @data['ask'], bid: @data['bid'],
- low: @data['low'], high: @data['high'],
- volume: @data['volume'],
- timestamp: @data['timestamp']
+ pair[:type], pair[:currency],
+ last: response['last_price'],
+ ask: response['ask'], bid: response['bid'],
+ low: response['low'], high: response['high'],
+ volume: response['volume'],
+ timestamp: response['timestamp']
)
end
end
end
end