Class: FixerIo::Response::LatestRates
- Inherits:
-
Object
- Object
- FixerIo::Response::LatestRates
- Defined in:
- lib/fixer_io/response/latest_rates.rb
Overview
Latest Rates response.
Instance Attribute Summary collapse
-
#base ⇒ Symbol
readonly
The three-letter currency code of the base currency used for this request.
-
#rates ⇒ Hash<Symbol, Numeric>
readonly
Exchange rate data for the currencies you have requested.
-
#timestamp ⇒ Time
readonly
The exact date and time the given rates were collected.
Instance Method Summary collapse
-
#initialize(args) ⇒ LatestRates
constructor
Create a new instance.
Constructor Details
#initialize(args) ⇒ LatestRates
Create a new instance.
28 29 30 31 32 |
# File 'lib/fixer_io/response/latest_rates.rb', line 28 def initialize(args) @timestamp = Time.at args[:timestamp].to_i @base = args[:base].downcase.to_sym @rates = Response.symbolize_hash_keys args[:rates] end |
Instance Attribute Details
#base ⇒ Symbol (readonly)
The three-letter currency code of the base currency used for this request.
14 15 16 |
# File 'lib/fixer_io/response/latest_rates.rb', line 14 def base @base end |
#rates ⇒ Hash<Symbol, Numeric> (readonly)
Exchange rate data for the currencies you have requested.
18 19 20 |
# File 'lib/fixer_io/response/latest_rates.rb', line 18 def rates @rates end |
#timestamp ⇒ Time (readonly)
The exact date and time the given rates were collected.
9 10 11 |
# File 'lib/fixer_io/response/latest_rates.rb', line 9 def @timestamp end |