Module: OpenHAB::DSL::MonkeyPatch::JavaExtensions::LocalTimeExtensions

Includes:
TimeExtensions, Log
Defined in:
lib/openhab/dsl/monkey_patch/java/local_time.rb

Overview

Extend LocalTime class to support arithmetic operators

Instance Method Summary collapse

Methods included from Log

included, logger

Methods included from TimeExtensions

#+, #-, #<=>

Instance Method Details

#compare_to(other) ⇒ Integer

Comparison

Parameters:

  • other (LocalTime, TimeOfDay)

    object to compare to

Returns:

  • (Integer)

    -1, 0, +1 depending on whether other is less than, equal to, or greater than self



33
34
35
36
37
# File 'lib/openhab/dsl/monkey_patch/java/local_time.rb', line 33

def compare_to(other)
  logger.trace("(#{self.class}) #{self} compare_to #{other} (#{other.class})")
  other = other.local_time if other.is_a?(TimeOfDay)
  super
end