Class: Duration::Hours

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/Duration/Hours.rb

Instance Method Summary collapse

Methods included from Common

#ago, #hence

Instance Method Details

#to_daysObject



28
29
30
# File 'lib/Duration/Hours.rb', line 28

def to_days
  Duration::Days.new(@hours/24)
end

#to_fObject



44
45
46
# File 'lib/Duration/Hours.rb', line 44

def to_f
  @hours
end

#to_hoursObject



24
25
26
# File 'lib/Duration/Hours.rb', line 24

def to_hours
  self
end

#to_iObject



40
41
42
# File 'lib/Duration/Hours.rb', line 40

def to_i
  @hours.to_i
end

#to_millisecondsObject



12
13
14
# File 'lib/Duration/Hours.rb', line 12

def to_milliseconds
  to_minutes.to_milliseconds
end

#to_minutesObject



20
21
22
# File 'lib/Duration/Hours.rb', line 20

def to_minutes
  Duration::Minutes.new(@hours * 60)
end

#to_monthsObject



36
37
38
# File 'lib/Duration/Hours.rb', line 36

def to_months
  to_days.to_months
end

#to_secondsObject



16
17
18
# File 'lib/Duration/Hours.rb', line 16

def to_seconds
  to_minutes.to_seconds
end

#to_weeksObject



32
33
34
# File 'lib/Duration/Hours.rb', line 32

def to_weeks
  to_days.to_weeks
end