Class: EDTF::Decade

Inherits:
Epoch
  • Object
show all
Defined in:
lib/edtf/epoch.rb

Instance Attribute Summary

Attributes inherited from Epoch

#year

Instance Method Summary collapse

Methods inherited from Epoch

#<=>, #initialize, #to_date

Constructor Details

This class inherits a constructor from EDTF::Epoch

Instance Method Details

#to_edtfObject



53
54
55
# File 'lib/edtf/epoch.rb', line 53

def to_edtf
  '%03dx' % (year / 10)
end

#to_rangeObject



48
49
50
51
# File 'lib/edtf/epoch.rb', line 48

def to_range
  d = to_date
  d .. d.years_since(10).end_of_year
end