Class: Duration::Seconds
- Inherits:
-
Object
- Object
- Duration::Seconds
- Includes:
- Common
- Defined in:
- lib/Duration/Seconds.rb
Instance Method Summary collapse
- #to_days ⇒ Object
- #to_f ⇒ Object
- #to_hours ⇒ Object
- #to_i ⇒ Object
- #to_milliseconds ⇒ Object
- #to_minutes ⇒ Object
- #to_months ⇒ Object
- #to_seconds ⇒ Object
- #to_weeks ⇒ Object
Methods included from Common
Instance Method Details
#to_days ⇒ Object
28 29 30 |
# File 'lib/Duration/Seconds.rb', line 28 def to_days to_minutes.to_days end |
#to_f ⇒ Object
44 45 46 |
# File 'lib/Duration/Seconds.rb', line 44 def to_f @seconds end |
#to_hours ⇒ Object
24 25 26 |
# File 'lib/Duration/Seconds.rb', line 24 def to_hours to_minutes.to_hours end |
#to_i ⇒ Object
40 41 42 |
# File 'lib/Duration/Seconds.rb', line 40 def to_i @seconds.to_i end |
#to_milliseconds ⇒ Object
12 13 14 |
# File 'lib/Duration/Seconds.rb', line 12 def to_milliseconds Duration::Milliseconds.new(@seconds * 1000) end |
#to_minutes ⇒ Object
20 21 22 |
# File 'lib/Duration/Seconds.rb', line 20 def to_minutes Duration::Minutes.new(@seconds/60) end |
#to_months ⇒ Object
36 37 38 |
# File 'lib/Duration/Seconds.rb', line 36 def to_months to_minutes.to_months end |
#to_seconds ⇒ Object
16 17 18 |
# File 'lib/Duration/Seconds.rb', line 16 def to_seconds self end |
#to_weeks ⇒ Object
32 33 34 |
# File 'lib/Duration/Seconds.rb', line 32 def to_weeks to_minutes.to_weeks end |