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



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

def days() 24 * hours end

#decadesObject



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

def decades() 10 * years end

#hoursObject



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

def hours() 60 * minutes end

#microsecondsObject

:nodoc:



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

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

#millisecondsObject



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

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

#minutesObject



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

def minutes() 60 * seconds end

#monthsObject



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

def months() 30 * days end

#secondsObject



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

def seconds() self end

#weeksObject



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

def weeks() 7 * days end

#yearsObject



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

def years() 365 * days end