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



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

def to_days
  self
end

#to_fObject



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

def to_f
  @days.to_f
end

#to_hoursObject



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

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

#to_iObject



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

def to_i
  @days.to_i
end

#to_microsecondsObject



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

def to_microseconds
  to_hours.to_microseconds
end

#to_millisecondsObject



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

def to_milliseconds
  to_hours.to_milliseconds
end

#to_minutesObject



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

def to_minutes
  to_hours.to_minutes
end

#to_monthsObject



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

def to_months
  to_weeks.to_months
end

#to_nanosecondsObject



11
12
13
# File 'lib/Duration/Days.rb', line 11

def to_nanoseconds
  to_hours.to_nanoseconds
end

#to_secondsObject



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

def to_seconds
  to_hours.to_seconds
end

#to_weeksObject



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

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