Class: EDTF::Decade
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_edtf ⇒ Object
53
54
55
|
# File 'lib/edtf/epoch.rb', line 53
def to_edtf
'%03dx' % (year / 10)
end
|
#to_range ⇒ Object
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
|