Class: Ctfc
- Inherits:
-
CTFC::Data
- Object
- CTFC::Data
- Ctfc
- Defined in:
- lib/ctfc.rb
Overview
Note:
For instance methods look at CTFC::Data.
For easier job use Ctfc, instead of typing CTFC::Data. You can define default coins with Ctfc::COINS=
Direct Known Subclasses
Constant Summary
Constants included from CTFC::CONFIG
CTFC::CONFIG::COINS, CTFC::CONFIG::MAX_RETRY, CTFC::CONFIG::URL
Instance Attribute Summary
Attributes inherited from CTFC::Data
#coins, #count, #data, #fiat, #prices, #response, #table, #url
Class Method Summary collapse
-
.to(currency, opts = {}) ⇒ Hash
CTFC::Data#prices || CTFC::Data#response.
Instance Method Summary collapse
-
#initialize(currency = :eur, opts = {}) ⇒ Ctfc
constructor
A new instance of Ctfc.
Methods inherited from CTFC::Data
#get, #price, #print=, #print?, #save=, #save?, #success?
Constructor Details
#initialize(currency = :eur, opts = {}) ⇒ Ctfc
TODO:
Allow Ctfc to use proxy and/or tor
Returns a new instance of Ctfc.
15 16 17 18 |
# File 'lib/ctfc.rb', line 15 def initialize(currency = :eur, opts = {}) opts[:coins] ||= COINS super(currency, opts) end |
Class Method Details
.to(currency, opts = {}) ⇒ Hash
Returns CTFC::Data#prices || CTFC::Data#response.
34 35 36 |
# File 'lib/ctfc.rb', line 34 def self.to(currency, opts = {}) new(currency.to_sym, opts).get end |