Class: OpenHAB::Core::Registry Abstract
- Inherits:
-
Object
- Object
- OpenHAB::Core::Registry
- 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
-
#provider_for(key) ⇒ org.openhab.core.common.registry.Provider
Determines which provider an element is associated with.
Instance Attribute Details
#providers ⇒ Enumerable<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.
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 |