Class: OpenHAB::Core::Registry Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/openhab/core/registry.rb

Overview

This class is abstract.

The base class for all registries in openHAB.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#providersEnumerable<org.openhab.core.common.registry.Provider> (readonly)



35
36
37
# File 'lib/openhab/core/registry.rb', line 35

def providers
  providerToElements.keys
end

Instance Method Details

#provider_for(key) ⇒ org.openhab.core.common.registry.Provider

Determines which provider an element is associated with.

Parameters:

  • key (Object)

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/openhab/core/registry.rb', line 20

def provider_for(key)
  elementReadLock.lock
  if key.is_a?(org.openhab.core.common.registry.Identifiable)
    element = key
  else
    return nil unless (element = identifierToElement[key])
  end

  elementToProvider[element]
ensure
  elementReadLock.unlock
end