Class: Hiccup::Enumerable::AnnuallyEnumerator

Inherits:
ScheduleEnumerator show all
Defined in:
lib/hiccup/enumerable/annually_enumerator.rb

Instance Attribute Summary collapse

Attributes inherited from ScheduleEnumerator

#cursor, #schedule, #seed_date

Instance Method Summary collapse

Methods inherited from ScheduleEnumerator

#ends?, enum_for, #next, #prev, #started?

Constructor Details

#initialize(*args) ⇒ AnnuallyEnumerator

Returns a new instance of AnnuallyEnumerator.



7
8
9
10
11
12
13
14
15
16
# File 'lib/hiccup/enumerable/annually_enumerator.rb', line 7

def initialize(*args)
  super
  @month, @day = start_date.month, start_date.day
  
  if month == 2 and day == 29
    def self.current_date
      Date.new(year, 2, leap_year?(year) ? 29 : 28)
    end
  end
end

Instance Attribute Details

#dayObject (readonly)

Returns the value of attribute day.



18
19
20
# File 'lib/hiccup/enumerable/annually_enumerator.rb', line 18

def day
  @day
end

#monthObject (readonly)

Returns the value of attribute month.



18
19
20
# File 'lib/hiccup/enumerable/annually_enumerator.rb', line 18

def month
  @month
end