Class: JSONVAT::Period
- Inherits:
-
Object
- Object
- JSONVAT::Period
- Defined in:
- lib/json_vat/period.rb
Instance Method Summary collapse
- #effective_from ⇒ Object
-
#initialize(country, attributes) ⇒ Period
constructor
A new instance of Period.
- #rates ⇒ Object
Constructor Details
#initialize(country, attributes) ⇒ Period
Returns a new instance of Period.
6 7 8 |
# File 'lib/json_vat/period.rb', line 6 def initialize(country, attributes) @country, @attributes = country, attributes end |
Instance Method Details
#effective_from ⇒ Object
10 11 12 |
# File 'lib/json_vat/period.rb', line 10 def effective_from @effective_from ||= Date.parse(@attributes['effective_from']) end |
#rates ⇒ Object
14 15 16 |
# File 'lib/json_vat/period.rb', line 14 def rates @attributes['rates'] || {} end |