Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/ironnails/core_ext/fixnum.rb
Instance Method Summary collapse
Instance Method Details
#minutes ⇒ Object
14 15 16 |
# File 'lib/ironnails/core_ext/fixnum.rb', line 14 def minutes self * 60 end |
#seconds ⇒ Object
18 19 20 |
# File 'lib/ironnails/core_ext/fixnum.rb', line 18 def seconds self end |
#to_timespan(as = :seconds) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/ironnails/core_ext/fixnum.rb', line 3 def to_timespan(as=:seconds) case as when :hours || :hour TimeSpan.new(self, 0, 0) when :minutes || :minute TimeSpan.new(0, self, 0) else TimeSpan.new(0, 0, self) end end |