class ExchangeRate::Configuration
Stores configuration for the ::ExchangeRate
module.
See ::ExchangeRate
for examples.
Largely based on brandonhilkert.com/blog/ruby-gem-configuration-patterns/
Attributes
datastore_url[W]
The local cache database URL, e.g. 'sqlite://db/data.sqlite3'
rate_retriever[W]
The rate retriever to use for (e.g. ExchangeRate.retrieve
)
Public Instance Methods
datastore_url()
click to toggle source
Gets the local cache database URL, defaulting to a local SQLite3 file.
Returns the local cache URL.
# File lib/exchange_rate/configuration.rb, line 27 def datastore_url @datastore_url ||= 'sqlite://db/data.sqlite3' end
rate_retriever()
click to toggle source
Gets the rate retriever, defaulting to the built-in ECB retriever.
Returns the default ECB retriever unless one has been set
# File lib/exchange_rate/configuration.rb, line 15 def rate_retriever @rate_retriever ||= ExchangeRate::RateSources::ECBRateRetriever.new end