Class: Duration::Hours
- Inherits:
-
Object
- Object
- Duration::Hours
- Defined in:
- lib/Duration/Hours.rb
Instance Method Summary collapse
- #to_days ⇒ Object
- #to_f ⇒ Object
- #to_hours ⇒ Object
- #to_i ⇒ Object
- #to_microseconds ⇒ Object
- #to_milliseconds ⇒ Object
- #to_minutes ⇒ Object
- #to_months ⇒ Object
- #to_nanoseconds ⇒ Object
- #to_seconds ⇒ Object
- #to_weeks ⇒ Object
Methods included from Relative
Methods included from Common
Instance Method Details
#to_days ⇒ Object
38 39 40 |
# File 'lib/Duration/Hours.rb', line 38 def to_days Duration::Days.new(@hours / 24r) end |
#to_f ⇒ Object
54 55 56 |
# File 'lib/Duration/Hours.rb', line 54 def to_f @hours.to_f end |
#to_hours ⇒ Object
34 35 36 |
# File 'lib/Duration/Hours.rb', line 34 def to_hours self end |
#to_i ⇒ Object
50 51 52 |
# File 'lib/Duration/Hours.rb', line 50 def to_i @hours.to_i end |
#to_microseconds ⇒ Object
18 19 20 |
# File 'lib/Duration/Hours.rb', line 18 def to_microseconds to_minutes.to_microseconds end |
#to_milliseconds ⇒ Object
22 23 24 |
# File 'lib/Duration/Hours.rb', line 22 def to_milliseconds to_minutes.to_milliseconds end |
#to_minutes ⇒ Object
30 31 32 |
# File 'lib/Duration/Hours.rb', line 30 def to_minutes Duration::Minutes.new(@hours * 60) end |
#to_months ⇒ Object
46 47 48 |
# File 'lib/Duration/Hours.rb', line 46 def to_months to_days.to_months end |
#to_nanoseconds ⇒ Object
14 15 16 |
# File 'lib/Duration/Hours.rb', line 14 def to_nanoseconds to_minutes.to_nanoseconds end |
#to_seconds ⇒ Object
26 27 28 |
# File 'lib/Duration/Hours.rb', line 26 def to_seconds to_minutes.to_seconds end |
#to_weeks ⇒ Object
42 43 44 |
# File 'lib/Duration/Hours.rb', line 42 def to_weeks to_days.to_weeks end |