Class: Integer

Inherits:
Object
  • Object
show all
Includes:
OpenHAB::CoreExt::Ruby::QuantityTypeConversion
Defined in:
lib/openhab/core_ext/ruby/numeric.rb

Overview

Extensions to Integer

Instance Method Summary collapse

Methods included from OpenHAB::CoreExt::Ruby::QuantityTypeConversion

#|

Instance Method Details

#daysPeriod Also known as: day

Create Period of ‘self` days

Returns:



57
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 57

def_period_method(:days)

#hoursDuration Also known as: hour

Create Duration of ‘self` hours

Returns:



55
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 55

def_duration_method(:hours)

#millisecondsDuration Also known as: millisecond, ms

Create Duration of ‘self` milliseconds

Returns:



46
47
48
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 46

def milliseconds
  Duration.of_millis(self)
end

#minutesDuration Also known as: minute

Create Duration of ‘self` minutes

Returns:



53
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 53

def_duration_method(:minutes)

#monthsPeriod Also known as: month

Create Period of ‘self` months

Returns:



59
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 59

def_period_method(:months)

#secondsDuration Also known as: second

Create Duration of ‘self` seconds

Returns:



51
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 51

def_duration_method(:seconds)

#yearsPeriod Also known as: year

Create Period of ‘self` years

Returns:



61
# File 'lib/openhab/core_ext/ruby/numeric.rb', line 61

def_period_method(:years)