Class: ReeDate::EndOfMonth

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_lib/packages/ree_date/package/ree_date/functions/end_of_month.rb

Instance Method Summary collapse

Instance Method Details

#call(date = nil) ⇒ Object



14
15
16
17
18
# File 'lib/ree_lib/packages/ree_date/package/ree_date/functions/end_of_month.rb', line 14

def call(date = nil)
  date = date || today
  last_day = days_in_month(date.month, date.year)
  change(date, day: last_day)
end