Class: MercadoBitcoin::Ticker
- Inherits:
-
BaseApiCall
- Object
- BaseApiCall
- MercadoBitcoin::Ticker
- 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
- #action ⇒ Object
-
#initialize(coin, opts = {}) ⇒ Ticker
constructor
A new instance of Ticker.
- #model ⇒ Object
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
#action ⇒ Object
9 10 11 |
# File 'lib/mercado_bitcoin/ticker.rb', line 9 def action @action ||= bitcoin? ? 'ticker' : 'ticker_litecoin' end |
#model ⇒ Object
13 14 15 |
# File 'lib/mercado_bitcoin/ticker.rb', line 13 def model MercadoBitcoin::Api::Data::Ticker end |