Class: Duration::Days

Inherits:
Object
  • Object
show all
Includes:
Common, Relative
Defined in:
lib/Duration/Days.rb

Instance Method Summary collapse

Methods included from Relative

#ago, #hence

Methods included from Common

#+, #-, #<=>

Instance Method Details

#to_daysObject



38
39
40
# File 'lib/Duration/Days.rb', line 38

def to_days
  self
end

#to_fObject



54
55
56
# File 'lib/Duration/Days.rb', line 54

def to_f
  @days.to_f
end

#to_hoursObject



34
35
36
# File 'lib/Duration/Days.rb', line 34

def to_hours
  Duration::Hours.new(@days * 24)
end

#to_iObject



50
51
52
# File 'lib/Duration/Days.rb', line 50

def to_i
  @days.to_i
end

#to_microsecondsObject



18
19
20
# File 'lib/Duration/Days.rb', line 18

def to_microseconds
  to_hours.to_microseconds
end

#to_millisecondsObject



22
23
24
# File 'lib/Duration/Days.rb', line 22

def to_milliseconds
  to_hours.to_milliseconds
end

#to_minutesObject



30
31
32
# File 'lib/Duration/Days.rb', line 30

def to_minutes
  to_hours.to_minutes
end

#to_monthsObject



46
47
48
# File 'lib/Duration/Days.rb', line 46

def to_months
  to_weeks.to_months
end

#to_nanosecondsObject



14
15
16
# File 'lib/Duration/Days.rb', line 14

def to_nanoseconds
  to_hours.to_nanoseconds
end

#to_secondsObject



26
27
28
# File 'lib/Duration/Days.rb', line 26

def to_seconds
  to_hours.to_seconds
end

#to_weeksObject



42
43
44
# File 'lib/Duration/Days.rb', line 42

def to_weeks
  Duration::Weeks.new(@days / 7r)
end