Class: Hiccup::Enumerable::AnnuallyEnumerator
- Inherits:
-
ScheduleEnumerator
- Object
- ScheduleEnumerator
- Hiccup::Enumerable::AnnuallyEnumerator
- Defined in:
- lib/hiccup/enumerable/annually_enumerator.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
Attributes inherited from ScheduleEnumerator
#cursor, #schedule, #seed_date
Instance Method Summary collapse
-
#initialize(*args) ⇒ AnnuallyEnumerator
constructor
A new instance of AnnuallyEnumerator.
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
#day ⇒ Object (readonly)
Returns the value of attribute day.
18 19 20 |
# File 'lib/hiccup/enumerable/annually_enumerator.rb', line 18 def day @day end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
18 19 20 |
# File 'lib/hiccup/enumerable/annually_enumerator.rb', line 18 def month @month end |