Class: GOBL::Currency::ExchangeRate

Inherits:
Object show all
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

Method Summary

Methods inherited from Object

new

Methods inherited from Struct

#as_json, from_data, from_json!, #to_json

Instance Attribute Details

#amountGOBL::Num::Amount (readonly)

How much is 1 of the “from” currency worth in the “to” currency.

Returns:



40
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 40

property :amount, GOBL::Num::Amount

#atGOBL::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.

Returns:



30
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 30

property :at, GOBL::Cal::DateTime

#fromGOBL::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

#sourceGOBL::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.

Returns:



35
# File 'lib/generated/gobl/currency/exchange_rate.rb', line 35

property :source, GOBL::CBC::Key

#toGOBL::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