Class: ExchangeRate::CurrencyRate

Inherits:
Object
  • Object
show all
Defined in:
lib/exchange_rate/currency_rate.rb

Overview

A currency/rate/date tuple. Represents the value of the currency on a specific date, in Euro Examples

CurrencyRate.new(currency = 'GBP',
                 value_in_euro = 0.001,
                 date_of_rate = Date.parse('2019-03-30'))

Instance Method Summary collapse

Instance Method Details

#validateObject

:attr_writer: date_of_rate The effective date of this FX rate for the currency



29
30
31
32
# File 'lib/exchange_rate/currency_rate.rb', line 29

def validate
  super
  validates_presence %i[currency value_in_euro date_of_rate]
end