Class: Duration::Months

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

Instance Method Summary collapse

Methods included from Common

#ago, #hence

Instance Method Details

#to_daysObject



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

def to_days
  to_weeks.to_days
end

#to_fObject



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

def to_f
  @months
end

#to_hoursObject



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

def to_hours
  to_weeks.to_hours
end

#to_iObject



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

def to_i
  @months.to_i
end

#to_millisecondsObject



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

def to_milliseconds
  to_weeks.to_milliseconds
end

#to_minutesObject



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

def to_minutes
  to_weeks.to_minutes
end

#to_monthsObject



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

def to_months
  self
end

#to_secondsObject



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

def to_seconds
  to_weeks.to_seconds
end

#to_weeksObject



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

def to_weeks
  # A month is the Gregorian mean: 2629746 seconds against 604800 per week.
  Duration::Weeks.new(@months * 2629746 / 604800.0)
end