Class: OpenHAB::Core::Types::OpenClosedType

Inherits:
Object
  • Object
show all
Includes:
State
Defined in:
lib/openhab/core/types/open_closed_type.rb

Overview

Implements OPEN and CLOSED states.

Constant Summary collapse

OPEN =

Open State

CLOSED =

Closed State

Instance Method Summary collapse

Methods included from Type

#==, #eql?

Instance Method Details

#!OpenClosedType

Invert the type

Returns:



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

def !
  return CLOSED if open?

  OPEN if closed?
end

#closed?true, false

Check if self == CLOSED

Returns:

  • (true, false)


# File 'lib/openhab/core/types/open_closed_type.rb', line 23

#open?true, false

Check if self == OPEN

Returns:

  • (true, false)


# File 'lib/openhab/core/types/open_closed_type.rb', line 19