Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/runt.rb

Overview

Useful shortcuts!

Contributed by Ara T. Howard who is pretty sure he got the idea from somewhere else. :-)

Instance Method Summary collapse

Instance Method Details

#daysObject



239
# File 'lib/runt.rb', line 239

def days() 24 * hours end

#decadesObject



243
# File 'lib/runt.rb', line 243

def decades() 10 * years end

#hoursObject



238
# File 'lib/runt.rb', line 238

def hours() 60 * minutes end

#microsecondsObject

:nodoc:



234
# File 'lib/runt.rb', line 234

def microseconds() Float(self  * (10 ** -6)) end

#millisecondsObject



235
# File 'lib/runt.rb', line 235

def milliseconds() Float(self  * (10 ** -3)) end

#minutesObject



237
# File 'lib/runt.rb', line 237

def minutes() 60 * seconds end

#monthsObject



241
# File 'lib/runt.rb', line 241

def months() 30 * days end

#secondsObject



236
# File 'lib/runt.rb', line 236

def seconds() self end

#weeksObject



240
# File 'lib/runt.rb', line 240

def weeks() 7 * days end

#yearsObject



242
# File 'lib/runt.rb', line 242

def years() 365 * days end