Module: RecurringDate
- Included in:
- Date
- Defined in:
- lib/recurring_date.rb,
lib/recurring_date/version.rb,
lib/recurring_date/enumerator.rb
Overview
The RecurringDate module is extension to Date class.
Defined Under Namespace
Classes: Enumerator
Constant Summary collapse
- VERSION =
'0.1.5'
Instance Method Summary collapse
-
#mweek ⇒ Object
The week number of the month.
-
#to_enum ⇒ Object
Initiate a lazy, perpetual enumerator over all dates, day by day, after
self
(includingself
).
Instance Method Details
#mweek ⇒ Object
The week number of the month.
8 9 10 |
# File 'lib/recurring_date.rb', line 8 def mweek (mday - 1) / 7 + 1 end |
#to_enum ⇒ Object
Initiate a lazy, perpetual enumerator over all dates, day by day, after self
(including self
).
13 14 15 |
# File 'lib/recurring_date.rb', line 13 def to_enum RecurringDate::Enumerator.from(self) end |