Module: Repeatable::LastDateOfMonth

Extended by:
T::Sig
Included in:
Expression::DayInMonth, Expression::WeekdayInMonth
Defined in:
lib/repeatable/last_date_of_month.rb

Instance Method Summary collapse

Instance Method Details

#last_date_of_month(date) ⇒ ::Date

Parameters:

  • date (::Date)

Returns:

  • (::Date)


8
9
10
# File 'lib/repeatable/last_date_of_month.rb', line 8

def last_date_of_month(date)
  ::Date.new(date.next_month.year, date.next_month.month, 1).prev_day
end