Module: Chronos::Numeric::Gregorian
- Included in:
- Numeric
- Defined in:
- lib/chronos/numeric/gregorian.rb
Instance Method Summary collapse
-
#centuries(language) ⇒ Object
(also: #century)
Get a duration of the receivers amount of centuries.
-
#days(language) ⇒ Object
(also: #day)
Get a duration of the receivers amount of days.
-
#decades(language) ⇒ Object
(also: #decade)
Get a duration of the receivers amount of decades.
-
#hours(language) ⇒ Object
(also: #hour)
Get a duration of the receivers amount of hours.
-
#microseconds(language) ⇒ Object
(also: #microsecond)
Get a duration of the receivers amount of microseconds.
-
#milliseconds(language) ⇒ Object
(also: #millisecond)
Get a duration of the receivers amount of milliseconds.
-
#minutes(language) ⇒ Object
(also: #minute)
Get a duration of the receivers amount of minutes.
-
#months(language) ⇒ Object
(also: #month)
Get a duration of the receivers amount of months.
-
#nanoseconds(language) ⇒ Object
(also: #nanosecond)
Get a duration of the receivers amount of nanoseconds.
-
#picoseconds(language) ⇒ Object
(also: #picosecond)
Get a duration of the receivers amount of picoseconds.
-
#seconds(language) ⇒ Object
(also: #second)
Get a duration of the receivers amount of seconds.
-
#weeks(language) ⇒ Object
(also: #week)
Get a duration of the receivers amount of weeks.
-
#years(language) ⇒ Object
(also: #year)
Get a duration of the receivers amount of years.
Instance Method Details
#centuries(language) ⇒ Object Also known as: century
Get a duration of the receivers amount of centuries
90 91 92 |
# File 'lib/chronos/numeric/gregorian.rb', line 90 def centuries(language) ::Chronos::Duration::Gregorian.new(self*1200, 0, 0, language) end |
#days(language) ⇒ Object Also known as: day
Get a duration of the receivers amount of days
60 61 62 |
# File 'lib/chronos/numeric/gregorian.rb', line 60 def days(language) ::Chronos::Duration::Gregorian.new(0, self, 0, language) end |
#decades(language) ⇒ Object Also known as: decade
Get a duration of the receivers amount of decades
84 85 86 |
# File 'lib/chronos/numeric/gregorian.rb', line 84 def decades(language) ::Chronos::Duration::Gregorian.new(self*144, 0, 0, language) end |
#hours(language) ⇒ Object Also known as: hour
Get a duration of the receivers amount of hours
54 55 56 |
# File 'lib/chronos/numeric/gregorian.rb', line 54 def hours(language) ::Chronos::Duration::Gregorian.new(0, 0, self*::Chronos::PS_IN_HOUR, language) end |
#microseconds(language) ⇒ Object Also known as: microsecond
Get a duration of the receivers amount of microseconds
30 31 32 |
# File 'lib/chronos/numeric/gregorian.rb', line 30 def microseconds(language) ::Chronos::Duration::Gregorian.new(0, 0, self*::Chronos::PS_IN_MICROSECOND, language) end |
#milliseconds(language) ⇒ Object Also known as: millisecond
Get a duration of the receivers amount of milliseconds
36 37 38 |
# File 'lib/chronos/numeric/gregorian.rb', line 36 def milliseconds(language) ::Chronos::Duration::Gregorian.new(0, 0, self*::Chronos::PS_IN_MILLISECOND, language) end |
#minutes(language) ⇒ Object Also known as: minute
Get a duration of the receivers amount of minutes
48 49 50 |
# File 'lib/chronos/numeric/gregorian.rb', line 48 def minutes(language) ::Chronos::Duration::Gregorian.new(0, 0, self*::Chronos::PS_IN_MINUTE, language) end |
#months(language) ⇒ Object Also known as: month
Get a duration of the receivers amount of months
72 73 74 |
# File 'lib/chronos/numeric/gregorian.rb', line 72 def months(language) ::Chronos::Duration::Gregorian.new(self, 0, 0, language) end |
#nanoseconds(language) ⇒ Object Also known as: nanosecond
Get a duration of the receivers amount of nanoseconds
24 25 26 |
# File 'lib/chronos/numeric/gregorian.rb', line 24 def nanoseconds(language) ::Chronos::Duration::Gregorian.new(0, 0, self*::Chronos::PS_IN_NANOSECOND, language) end |
#picoseconds(language) ⇒ Object Also known as: picosecond
Get a duration of the receivers amount of picoseconds
18 19 20 |
# File 'lib/chronos/numeric/gregorian.rb', line 18 def picoseconds(language) ::Chronos::Duration::Gregorian.new(0, 0, self, 0, language) end |
#seconds(language) ⇒ Object Also known as: second
Get a duration of the receivers amount of seconds
42 43 44 |
# File 'lib/chronos/numeric/gregorian.rb', line 42 def seconds(language) ::Chronos::Duration::Gregorian.new(0, 0, self*::Chronos::PS_IN_SECOND, language) end |