Module: OpenHAB::Core::Types::NumericType

Included in:
DecimalType, QuantityType
Defined in:
lib/openhab/core/types/numeric_type.rb

Overview

Mixin for methods common to DecimalType and QuantityType.

Instance Method Summary collapse

Instance Method Details

#+@self

Returns:

  • (self)


37
38
39
# File 'lib/openhab/core/types/numeric_type.rb', line 37

def +@
  self
end

#eql?(other) ⇒ true, false

Check equality without type conversion

Returns:

  • (true, false)

    if the same value is represented, without type conversion



30
31
32
33
34
# File 'lib/openhab/core/types/numeric_type.rb', line 30

def eql?(other)
  return false unless other.instance_of?(self.class)

  compare_to(other).zero?
end

#to_dBigDecimal

Returns:

  • (BigDecimal)


# File 'lib/openhab/core/types/numeric_type.rb', line 41

#to_fFloat

Returns:



# File 'lib/openhab/core/types/numeric_type.rb', line 47

#to_iInteger

Returns:



# File 'lib/openhab/core/types/numeric_type.rb', line 44