Class: CryptoVal::FiatExchange::Fixer
- Inherits:
-
Object
- Object
- CryptoVal::FiatExchange::Fixer
- Defined in:
- lib/crypto_val/fiat_exchange/fixer.rb
Constant Summary collapse
- DEFAULT_SOURCE =
"USD"- DEFAULT_TARGET =
"PHP"
Instance Attribute Summary collapse
-
#source_currency ⇒ Object
readonly
Returns the value of attribute source_currency.
-
#target_currency ⇒ Object
readonly
Returns the value of attribute target_currency.
Class Method Summary collapse
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(opts = {}) ⇒ Fixer
constructor
A new instance of Fixer.
Constructor Details
#initialize(opts = {}) ⇒ Fixer
Returns a new instance of Fixer.
8 9 10 11 |
# File 'lib/crypto_val/fiat_exchange/fixer.rb', line 8 def initialize opts={} @source_currency = opts[:source_currency] || DEFAULT_SOURCE @target_currency = opts[:target_currency] || DEFAULT_TARGET end |
Instance Attribute Details
#source_currency ⇒ Object (readonly)
Returns the value of attribute source_currency.
6 7 8 |
# File 'lib/crypto_val/fiat_exchange/fixer.rb', line 6 def source_currency @source_currency end |
#target_currency ⇒ Object (readonly)
Returns the value of attribute target_currency.
6 7 8 |
# File 'lib/crypto_val/fiat_exchange/fixer.rb', line 6 def target_currency @target_currency end |
Class Method Details
.fetch(opts = {}) ⇒ Object
17 18 19 |
# File 'lib/crypto_val/fiat_exchange/fixer.rb', line 17 def self.fetch opts={} new(opts).fetch end |
Instance Method Details
#fetch ⇒ Object
13 14 15 |
# File 'lib/crypto_val/fiat_exchange/fixer.rb', line 13 def fetch format_response end |