Class: Numeric
Instance Method Summary collapse
- #days ⇒ Object
- #decades ⇒ Object
- #hours ⇒ Object
- #microseconds ⇒ Object
- #milliseconds ⇒ Object
- #minutes ⇒ Object
- #months ⇒ Object
- #of(head = nil, *tail, &b) ⇒ Object
- #seconds ⇒ Object
- #weeks ⇒ Object
- #years ⇒ Object
Instance Method Details
#days ⇒ Object
36 |
# File 'lib/alib-0.5.1/stdext.rb', line 36 def days() 24 * hours end |
#decades ⇒ Object
40 |
# File 'lib/alib-0.5.1/stdext.rb', line 40 def decades() 10 * years end |
#hours ⇒ Object
35 |
# File 'lib/alib-0.5.1/stdext.rb', line 35 def hours() 60 * minutes end |
#microseconds ⇒ Object
31 |
# File 'lib/alib-0.5.1/stdext.rb', line 31 def microseconds() Float(self * (10 ** -6)) end |
#milliseconds ⇒ Object
32 |
# File 'lib/alib-0.5.1/stdext.rb', line 32 def milliseconds() Float(self * (10 ** -3)) end |
#minutes ⇒ Object
34 |
# File 'lib/alib-0.5.1/stdext.rb', line 34 def minutes() 60 * seconds end |
#months ⇒ Object
38 |
# File 'lib/alib-0.5.1/stdext.rb', line 38 def months() 30 * days end |
#of(head = nil, *tail, &b) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/alib-0.5.1/stdext.rb', line 21 def of head = nil, *tail, &b #--{{{ if head a = tail.empty? ? head : [head]+tail b = lambda{ a } end Array.new(self).map &b #--}}} end |
#seconds ⇒ Object
33 |
# File 'lib/alib-0.5.1/stdext.rb', line 33 def seconds() self end |
#weeks ⇒ Object
37 |
# File 'lib/alib-0.5.1/stdext.rb', line 37 def weeks() 7 * days end |
#years ⇒ Object
39 |
# File 'lib/alib-0.5.1/stdext.rb', line 39 def years() 365 * days end |