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

Version Path
muflax-0.5.5 lib/muflax/time.rb
muflax-0.5.3 lib/muflax/time.rb
muflax-0.5.2 lib/muflax/time.rb
muflax-0.5.1 lib/muflax/time.rb
muflax-0.5.0 lib/muflax/time.rb
muflax-0.4.2 lib/muflax/time.rb
muflax-0.4.1 lib/muflax/time.rb
muflax-0.4.0 lib/muflax/time.rb
muflax-0.3.23 lib/muflax/time.rb
muflax-0.3.22 lib/muflax/time.rb
muflax-0.3.21 lib/muflax/time.rb
muflax-0.3.20 lib/muflax/time.rb
muflax-0.3.19 lib/muflax/time.rb
muflax-0.3.18 lib/muflax/time.rb
muflax-0.3.17 lib/muflax/time.rb
muflax-0.3.16 lib/muflax/time.rb