Sha256: 75d625f3b74ef334a237ca00077c859cc0f995808bf4bc00169d0bde8a260cfb
Contents?: true
Size: 355 Bytes
Versions: 126
Compression:
Stored size: 355 Bytes
Contents
# frozen_string_literal: true class ReeDatetime::YearsAgo include Ree::FnDSL fn :years_ago do link :now link :advance end doc("Returns a new date/time the specified number of years ago.") contract(Nilor[DateTime], Integer => DateTime) def call(date_time = nil, year_count) advance(date_time || now, years: -year_count) end end
Version data entries
126 entries across 126 versions & 1 rubygems