Sha256: 3bbbfdeec058b2de40795da06ccba977f6f3ea1f72545de3c2bd158519be4d20
Contents?: true
Size: 922 Bytes
Versions: 3
Compression:
Stored size: 922 Bytes
Contents
#!/usr/bin/env ruby # -*- encoding: utf-8 -*- # Copyright Freya Dorn <freya.siv.dorn@gmail.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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
muflax-0.7.0 | lib/muflax/time.rb |
muflax-0.6.1 | lib/muflax/time.rb |
muflax-0.6.0 | lib/muflax/time.rb |