Class: January

Inherits:
Month
  • Object
show all
Defined in:
lib/january.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.of(year) ⇒ Object



3
4
5
# File 'lib/january.rb', line 3

def self.of(year)
  January.for("1.1.#{year}")
end

Instance Method Details

#monthObject



15
16
17
# File 'lib/january.rb', line 15

def month
  1
end

#nextObject



7
8
9
# File 'lib/january.rb', line 7

def next
  January.for("1.1.#{year.to_i + 1}")
end

#previousObject



11
12
13
# File 'lib/january.rb', line 11

def previous
  January.for("1.1.#{year.to_i - 1}")
end

#yearObject



19
20
21
# File 'lib/january.rb', line 19

def year
  start_date.year
end