Class: ExchangeRate::Configuration
- Inherits:
-
Object
- Object
- ExchangeRate::Configuration
- Defined in:
- lib/exchange_rate/configuration.rb
Overview
Stores configuration for the ::ExchangeRate module.
See ::ExchangeRate for examples.
Largely based on brandonhilkert.com/blog/ruby-gem-configuration-patterns/
Instance Attribute Summary collapse
-
#datastore_url ⇒ Object
Gets the local cache database URL, defaulting to a local SQLite3 file.
-
#rate_retriever ⇒ Object
Gets the rate retriever, defaulting to the built-in ECB retriever.
Instance Attribute Details
#datastore_url ⇒ Object
Gets the local cache database URL, defaulting to a local SQLite3 file.
Returns the local cache URL.
27 28 29 |
# File 'lib/exchange_rate/configuration.rb', line 27 def datastore_url @datastore_url ||= 'sqlite://db/data.sqlite3' end |
#rate_retriever ⇒ Object
Gets the rate retriever, defaulting to the built-in ECB retriever.
Returns the default ECB retriever unless one has been set
15 16 17 |
# File 'lib/exchange_rate/configuration.rb', line 15 def rate_retriever @rate_retriever ||= ExchangeRate::RateSources::ECBRateRetriever.new end |