Sha256: b38d70e57633f17bdc77b6b32a436a35fd5d8e6609f1bd68cbe4a7bc8ddd3911
Contents?: true
Size: 914 Bytes
Versions: 15
Compression:
Stored size: 914 Bytes
Contents
#!/usr/bin/env ruby # -*- encoding: utf-8 -*- # Copyright Steffi 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
15 entries across 15 versions & 1 rubygems