class Calrom::Year

Public Class Methods

new(year) click to toggle source
Calls superclass method
# File lib/calrom/date_range.rb, line 29
def initialize(year)
  super Date.new(year, 1, 1), Date.new(year, 12, 31)
end

Public Instance Methods

each_month() { |month| ... } click to toggle source
# File lib/calrom/date_range.rb, line 37
def each_month
  return to_enum(:each_month) unless block_given?

  1.upto(12) {|month| yield Month.new(first.year, month) }
end
to_s() click to toggle source
# File lib/calrom/date_range.rb, line 33
def to_s
  first.year.to_s
end