Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/timerizer.rb
Overview
Monkey-patched Integer class enabled to return Timerizer::Durations.
Instance Method Summary collapse
-
#centuries(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#century(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#day(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#days(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#decade(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#decades(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#hour(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#hours(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#millennia(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#millennium(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#minute(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#minutes(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#month(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#months(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#second(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#seconds(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#week(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#weeks(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#year(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
-
#years(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit.
Instance Method Details
#centuries(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(centuries: self)`.
225 |
# File 'lib/timerizer.rb', line 225 self._define_duration_unit(:centuries) |
#century(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(century: self)`.
235 |
# File 'lib/timerizer.rb', line 235 self._define_duration_unit(:century) |
#day(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(day: self)`.
230 |
# File 'lib/timerizer.rb', line 230 self._define_duration_unit(:day) |
#days(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(days: self)`.
220 |
# File 'lib/timerizer.rb', line 220 self._define_duration_unit(:days) |
#decade(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(decade: self)`.
234 |
# File 'lib/timerizer.rb', line 234 self._define_duration_unit(:decade) |
#decades(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(decades: self)`.
224 |
# File 'lib/timerizer.rb', line 224 self._define_duration_unit(:decades) |
#hour(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(hour: self)`.
229 |
# File 'lib/timerizer.rb', line 229 self._define_duration_unit(:hour) |
#hours(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(hours: self)`.
219 |
# File 'lib/timerizer.rb', line 219 self._define_duration_unit(:hours) |
#millennia(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(millennia: self)`.
226 |
# File 'lib/timerizer.rb', line 226 self._define_duration_unit(:millennia) |
#millennium(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(millennium: self)`.
236 |
# File 'lib/timerizer.rb', line 236 self._define_duration_unit(:millennium) |
#minute(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(minute: self)`.
228 |
# File 'lib/timerizer.rb', line 228 self._define_duration_unit(:minute) |
#minutes(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(minutes: self)`.
218 |
# File 'lib/timerizer.rb', line 218 self._define_duration_unit(:minutes) |
#month(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(month: self)`.
232 |
# File 'lib/timerizer.rb', line 232 self._define_duration_unit(:month) |
#months(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(months: self)`.
222 |
# File 'lib/timerizer.rb', line 222 self._define_duration_unit(:months) |
#second(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(second: self)`.
227 |
# File 'lib/timerizer.rb', line 227 self._define_duration_unit(:second) |
#seconds(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(seconds: self)`.
217 |
# File 'lib/timerizer.rb', line 217 self._define_duration_unit(:seconds) |
#week(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(week: self)`.
231 |
# File 'lib/timerizer.rb', line 231 self._define_duration_unit(:week) |
#weeks(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(weeks: self)`.
221 |
# File 'lib/timerizer.rb', line 221 self._define_duration_unit(:weeks) |
#year(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(year: self)`.
233 |
# File 'lib/timerizer.rb', line 233 self._define_duration_unit(:year) |
#years(other = nil) ⇒ Timerizer::Duration
Return a Timerizer::Duration with ‘self` of the given unit. This method is a helper that is equivalent to `Timerizer::Duration::new(years: self)`.
223 |
# File 'lib/timerizer.rb', line 223 self._define_duration_unit(:years) |