#!/usr/bin/env ruby # -*- encoding: utf-8 -*- # Copyright Freya Dorn , 2017 # License: GNU APGLv3 (or later) 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