Class: JSONVAT::Period

Inherits:
Object
  • Object
show all
Defined in:
lib/json_vat/period.rb

Instance Method Summary collapse

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_fromObject



10
11
12
# File 'lib/json_vat/period.rb', line 10

def effective_from
  @effective_from ||= Date.parse(@attributes['effective_from'])
end

#ratesObject



14
15
16
# File 'lib/json_vat/period.rb', line 14

def rates
  @attributes['rates'] || {}
end