Class: EDTF::Century

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



38
39
40
# File 'lib/edtf/epoch.rb', line 38

def to_edtf
  '%02dxx' % (year / 100)
end

#to_rangeObject



33
34
35
36
# File 'lib/edtf/epoch.rb', line 33

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