Sha256: b62898cdf68d962b315abe128140a44990124dba885bbe4643880c55c0544346
Contents?: true
Size: 1.01 KB
Versions: 41
Compression:
Stored size: 1.01 KB
Contents
module Ramaze module CoreExtensions # Extensions for Numeric module Numeric def seconds self end alias second seconds # 60 seconds in a minute def minutes self * 60 end alias minute minutes # 60 minutes in an hour def hours self * 3600 end alias hour hours # 24 hours in a day def days self * 86400 end alias day days # 7 days in a week def weeks self * 604800 end alias week weeks # 30 days in a month def months self * 2592000 end alias month months # 365.25 days in a year def years self * 31557600 end alias year years # Time in the past, i.e. 3.days.ago def ago t = Time.now t - self end alias before ago # Time in the future, i.e. 3.days.from_now def from_now t = Time.now t + self end alias since from_now end end end
Version data entries
41 entries across 41 versions & 5 rubygems