mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-25 04:22:28 +01:00
Refactor Quote
This commit is contained in:
parent
b1bc3ae1c0
commit
af9f63f002
@ -9,14 +9,7 @@ class Quote
|
||||
values do
|
||||
attribute :base, String, default: DEFAULT_BASE
|
||||
attribute :date, Date, default: proc { Currency.current_date }
|
||||
end
|
||||
|
||||
def rates
|
||||
@rates ||= find_rates
|
||||
end
|
||||
|
||||
def attributes
|
||||
super.merge(rates: rates)
|
||||
attribute :rates, Hash, default: :find_rates, lazy: true
|
||||
end
|
||||
|
||||
private
|
||||
|
Loading…
Reference in New Issue
Block a user