Sha256: 046ad0c58ac758a00dc3515d5292ab2d708c1d1b64907b08a4a5926e80df8660
Contents?: true
Size: 403 Bytes
Versions: 124
Compression:
Stored size: 403 Bytes
Contents
# frozen_string_literal: true class ReeDate::EndOfMonth include Ree::FnDSL fn :end_of_month do link :today link :days_in_month link :change end doc("Returns a new date representing the end of the month.") contract(Nilor[Date] => Date) def call(date = nil) date = date || today last_day = days_in_month(date.month, date.year) change(date, day: last_day) end end
Version data entries
124 entries across 124 versions & 1 rubygems