class Enumdate::DateEnumerator::YearlyByMonthday
Enumerate yealy dates by month-day like: Apr 22 s, e = Date.new(2021, 1, 1), Date.new(20100, 12, 31) Enumdate::YearlyByMonthday(start_date: s, end_date: e, month: 4, mday: 22, interval: 2).map(&:to_s) : => [2021-04-22, 2023-04-22, …, 2099-04-22]
Public Class Methods
new(first_date:, month:, mday:, interval: 1)
click to toggle source
Calls superclass method
Enumdate::DateEnumerator::Base::new
# File lib/enumdate/date_enumerator.rb, line 133 def initialize(first_date:, month:, mday:, interval: 1) super(first_date: first_date, interval: interval) @month, @mday = month, mday end
Private Instance Methods
frame_manager()
click to toggle source
# File lib/enumdate/date_enumerator.rb, line 140 def frame_manager DateFrame::Yearly end
occurrence_in_frame(date)
click to toggle source
# File lib/enumdate/date_enumerator.rb, line 144 def occurrence_in_frame(date) Date.new(date.year, @month, @mday) rescue Date::Error nil end