Class: Duration::Seconds

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

Instance Method Summary collapse

Methods included from Common

#ago, #hence

Instance Method Details

#to_daysObject



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

def to_days
  to_minutes.to_days
end

#to_fObject



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

def to_f
  @seconds
end

#to_hoursObject



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

def to_hours
  to_minutes.to_hours
end

#to_iObject



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

def to_i
  @seconds.to_i
end

#to_millisecondsObject



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

def to_milliseconds
  Duration::Milliseconds.new(@seconds * 1000)
end

#to_minutesObject



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

def to_minutes
  Duration::Minutes.new(@seconds/60)
end

#to_monthsObject



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

def to_months
  to_minutes.to_months
end

#to_secondsObject



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

def to_seconds
  self
end

#to_weeksObject



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

def to_weeks
  to_minutes.to_weeks
end