Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/openhab/core_ext/ruby/numeric.rb
Overview
Extensions to Integer
Instance Method Summary collapse
-
#days ⇒ Period
(also: #day)
Create Period of ‘self` days.
-
#hours ⇒ Duration
(also: #hour)
Create Duration of ‘self` hours.
-
#milliseconds ⇒ Duration
(also: #millisecond, #ms)
Create Duration of ‘self` milliseconds.
-
#minutes ⇒ Duration
(also: #minute)
Create Duration of ‘self` minutes.
-
#months ⇒ Period
(also: #month)
Create Period of ‘self` months.
-
#seconds ⇒ Duration
(also: #second)
Create Duration of ‘self` seconds.
-
#years ⇒ Period
(also: #year)
Create Period of ‘self` years.
Methods included from OpenHAB::CoreExt::Ruby::QuantityTypeConversion
Instance Method Details
#days ⇒ Period Also known as: day
Create Period of ‘self` days
57 |
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 57 def_period_method(:days) |
#hours ⇒ Duration Also known as: hour
Create Duration of ‘self` hours
55 |
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 55 def_duration_method(:hours) |
#milliseconds ⇒ Duration Also known as: millisecond, ms
Create Duration of ‘self` milliseconds
46 47 48 |
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 46 def milliseconds Duration.of_millis(self) end |
#minutes ⇒ Duration Also known as: minute
Create Duration of ‘self` minutes
53 |
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 53 def_duration_method(:minutes) |
#months ⇒ Period Also known as: month
Create Period of ‘self` months
59 |
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 59 def_period_method(:months) |