Duration::Numeric

Numeric Extensions for Durations

Public Instance Methods

day() click to toggle source
Alias for: days
days() click to toggle source

Converts days into seconds.

     # File lib/more/facets/duration.rb, line 236
236:     def days ; Duration[self * 86400] ; end
Also aliased as: day
fortnight() click to toggle source
Alias for: fortnights
fortnights() click to toggle source

Converts fortnights into seconds. (A fortnight is 2 weeks)

     # File lib/more/facets/duration.rb, line 245
245:     def fortnights ; Duration[self * 1209600] ; end
Also aliased as: fortnight
hour() click to toggle source
Alias for: hours
hours() click to toggle source

Converts hours into seconds.

     # File lib/more/facets/duration.rb, line 231
231:     def hours ; Duration[self * 3600] ; end
Also aliased as: hour
minute() click to toggle source
Alias for: minutes
minutes() click to toggle source

Converts minutes into seconds.

     # File lib/more/facets/duration.rb, line 227
227:     def minutes ; Duration[self * 60] ; end
Also aliased as: minute
month() click to toggle source
Alias for: months
months() click to toggle source

Converts months into seconds. WARNING: This is not exact as it assumes 30 days to a month.

     # File lib/more/facets/duration.rb, line 250
250:     def months ; Duration[self * 30 * 86400] ; end
Also aliased as: month
second() click to toggle source
Alias for: seconds
seconds() click to toggle source

Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years. The base unit for all of these Numeric time methods is seconds.

     # File lib/more/facets/duration.rb, line 223
223:     def seconds ; Duration[self] ; end
Also aliased as: second
week() click to toggle source
Alias for: weeks
weeks() click to toggle source

Converts weeks into seconds.

     # File lib/more/facets/duration.rb, line 240
240:     def weeks ; Duration[self * 604800] ; end
Also aliased as: week
year() click to toggle source
Alias for: years
years() click to toggle source

Converts years into seconds. WARNING: This is not exact as it assumes 365 days to a year.

         ie. It doesn not account for leap years.
     # File lib/more/facets/duration.rb, line 256
256:     def years ; Duration[self * 365 * 86400, :years] ; end
Also aliased as: year

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.