Class: GOBL::Currency::ExchangeRate
- Defined in:
- lib/generated/gobl/currency/exchange_rate.rb
Overview
ExchangeRate contains data on the rate to be used when converting amounts from one currency into another.
Constant Summary collapse
- SCHEMA_ID =
The Schema ID of the GOBL ExchangeRate structure
'https://gobl.org/draft-0/currency/exchange-rate'
Instance Attribute Summary collapse
-
#amount ⇒ GOBL::Num::Amount
readonly
How much is 1 of the “from” currency worth in the “to” currency.
-
#at ⇒ GOBL::Cal::DateTime
readonly
At represents the effective date and time at which the exchange rate is determined by the source.
-
#from ⇒ GOBL::Currency::Code
readonly
Currency code this will be converted from.
-
#source ⇒ GOBL::CBC::Key
readonly
Source key provides a reference to the source the exchange rate was obtained from.
-
#to ⇒ GOBL::Currency::Code
readonly
Currency code this exchange rate will convert into.
Method Summary
Methods inherited from Object
Methods inherited from Struct
#as_json, from_data, from_json!, #to_json
Instance Attribute Details
#amount ⇒ GOBL::Num::Amount (readonly)
How much is 1 of the “from” currency worth in the “to” currency.
40 |
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 40 property :amount, GOBL::Num::Amount |
#at ⇒ GOBL::Cal::DateTime (readonly)
At represents the effective date and time at which the exchange rate is determined by the source. The time may be zero if referring to a specific day only.
30 |
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 30 property :at, GOBL::Cal::DateTime |
#from ⇒ GOBL::Currency::Code (readonly)
Currency code this will be converted from.
18 |
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 18 property :from, GOBL::Currency::Code |
#source ⇒ GOBL::CBC::Key (readonly)
Source key provides a reference to the source the exchange rate was obtained from. Typically this will be determined by an application used to update exchange rates automatically.
35 |
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 35 property :source, GOBL::CBC::Key |
#to ⇒ GOBL::Currency::Code (readonly)
Currency code this exchange rate will convert into.
24 |
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 24 property :to, GOBL::Currency::Code |