Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- 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
- #days ⇒ Object
- #decades ⇒ Object
- #hours ⇒ Object
-
#microseconds ⇒ Object
:nodoc:.
- #milliseconds ⇒ Object
- #minutes ⇒ Object
- #months ⇒ Object
- #seconds ⇒ Object
- #weeks ⇒ Object
- #years ⇒ Object
Instance Method Details
#days ⇒ Object
239 |
# File 'lib/runt.rb', line 239 def days() 24 * hours end |
#decades ⇒ Object
243 |
# File 'lib/runt.rb', line 243 def decades() 10 * years end |
#hours ⇒ Object
238 |
# File 'lib/runt.rb', line 238 def hours() 60 * minutes end |
#microseconds ⇒ Object
:nodoc:
234 |
# File 'lib/runt.rb', line 234 def microseconds() Float(self * (10 ** -6)) end |
#milliseconds ⇒ Object
235 |
# File 'lib/runt.rb', line 235 def milliseconds() Float(self * (10 ** -3)) end |
#minutes ⇒ Object
237 |
# File 'lib/runt.rb', line 237 def minutes() 60 * seconds end |
#months ⇒ Object
241 |
# File 'lib/runt.rb', line 241 def months() 30 * days end |
#seconds ⇒ Object
236 |
# File 'lib/runt.rb', line 236 def seconds() self end |
#weeks ⇒ Object
240 |
# File 'lib/runt.rb', line 240 def weeks() 7 * days end |
#years ⇒ Object
242 |
# File 'lib/runt.rb', line 242 def years() 365 * days end |