Class: Duration::Hours
Instance Method Summary
collapse
Methods included from Relative
#ago, #hence
Methods included from Common
#*, #+, #-, #/, #<=>, #inspect, #to_s
Instance Method Details
#to_days ⇒ Object
35
36
37
|
# File 'lib/Duration/Hours.rb', line 35
def to_days
Duration::Days.new(@hours / 24r)
end
|
#to_f ⇒ Object
51
52
53
|
# File 'lib/Duration/Hours.rb', line 51
def to_f
@hours.to_f
end
|
#to_hours ⇒ Object
31
32
33
|
# File 'lib/Duration/Hours.rb', line 31
def to_hours
self
end
|
#to_i ⇒ Object
47
48
49
|
# File 'lib/Duration/Hours.rb', line 47
def to_i
@hours.to_i
end
|
#to_microseconds ⇒ Object
15
16
17
|
# File 'lib/Duration/Hours.rb', line 15
def to_microseconds
to_minutes.to_microseconds
end
|
#to_milliseconds ⇒ Object
19
20
21
|
# File 'lib/Duration/Hours.rb', line 19
def to_milliseconds
to_minutes.to_milliseconds
end
|
#to_minutes ⇒ Object
27
28
29
|
# File 'lib/Duration/Hours.rb', line 27
def to_minutes
Duration::Minutes.new(@hours * 60)
end
|
#to_months ⇒ Object
43
44
45
|
# File 'lib/Duration/Hours.rb', line 43
def to_months
to_days.to_months
end
|
#to_nanoseconds ⇒ Object
11
12
13
|
# File 'lib/Duration/Hours.rb', line 11
def to_nanoseconds
to_minutes.to_nanoseconds
end
|
#to_seconds ⇒ Object
23
24
25
|
# File 'lib/Duration/Hours.rb', line 23
def to_seconds
to_minutes.to_seconds
end
|
#to_weeks ⇒ Object
39
40
41
|
# File 'lib/Duration/Hours.rb', line 39
def to_weeks
to_days.to_weeks
end
|