class Month

Public Instance Methods

to_date() click to toggle source

Does the same thing as Month#start_date, but to_<class> is a common idiom

for built-in class conversion methods.
# File lib/month/serializer.rb, line 102
def to_date
  Date.new(year, number, 1)
end
to_i() click to toggle source
# File lib/month/serializer.rb, line 90
def to_i
  yr = year
  mon = number
  if number == 12
    mon = 0
    yr += 1
  end
  yr * 12 + mon
end