Sha256: a39c035cf5280d2d8301caf4609ef4121a6f233a83c3e0ef013fb366ed313903
Contents?: true
Size: 915 Bytes
Versions: 16
Compression:
Stored size: 915 Bytes
Contents
#!/usr/bin/env ruby # -*- encoding: utf-8 -*- # Copyright Steffie Dorn <mail@muflax.com>, 2017 # License: GNU APGLv3 (or later) <http://www.gnu.org/copyleft/gpl.html> class Numeric def milliseconds ; self.seconds / 1000.0 ; end def seconds ; self ; end def minutes ; self.seconds * 60 ; end def hours ; self.minutes * 60 ; end def days ; self.hours * 24 ; end def weeks ; self.days * 7 ; end def fortnights ; self.weeks * 2 ; end def months ; self.days * 30 ; end def years ; self.days * 365 ; end # singular usage alias :millisecond :milliseconds alias :second :seconds alias :minute :minutes alias :hour :hours alias :day :days alias :week :weeks alias :fortnight :fortnights alias :month :months alias :year :years end
Version data entries
16 entries across 16 versions & 1 rubygems