Class: EDTF::Epoch

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Comparable, Enumerable
Defined in:
lib/edtf/epoch.rb

Direct Known Subclasses

Century, Decade

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(year = 0) ⇒ Epoch

Returns a new instance of Epoch.



16
17
# File 'lib/edtf/epoch.rb', line 16

def initialize(year = 0)
end

Instance Attribute Details

#yearObject Also known as: get

Returns the value of attribute year.



9
10
11
# File 'lib/edtf/epoch.rb', line 9

def year
  @year
end

Instance Method Details

#<=>(other) ⇒ Object



19
20
# File 'lib/edtf/epoch.rb', line 19

def <=>(other)
end

#to_dateObject



23
24
25
# File 'lib/edtf/epoch.rb', line 23

def to_date
  Date.new(year)
end