Class: MercadoBitcoin::Ticker

Inherits:
BaseApiCall show all
Defined in:
lib/mercado_bitcoin/ticker.rb

Defined Under Namespace

Classes: TickerParser

Instance Attribute Summary

Attributes inherited from BaseApiCall

#coin, #parsed, #parser, #parser_error_class, #response, #rest_client

Instance Method Summary collapse

Methods inherited from BaseApiCall

#base_url, #bitcoin?, #fetch, #get, #litecoin?, #params, #parse, #url, #valid_coin?

Constructor Details

#initialize(coin, opts = {}) ⇒ Ticker

Returns a new instance of Ticker.



4
5
6
7
# File 'lib/mercado_bitcoin/ticker.rb', line 4

def initialize(coin, opts = {})
  opts[:parser] = TickerParser
  super(coin, opts)
end

Instance Method Details

#actionObject



9
10
11
# File 'lib/mercado_bitcoin/ticker.rb', line 9

def action
  @action ||= bitcoin? ? 'ticker' : 'ticker_litecoin'
end

#modelObject



13
14
15
# File 'lib/mercado_bitcoin/ticker.rb', line 13

def model
  MercadoBitcoin::Api::Data::Ticker
end