Class: OpenHAB::Core::Items::Metadata::Provider
- Inherits:
-
Provider
- Object
- org.openhab.core.common.registry.AbstractProvider
- Provider
- OpenHAB::Core::Items::Metadata::Provider
- Defined in:
- lib/openhab/core/items/metadata/provider.rb
Overview
Provides metadata created in Ruby to openHAB
Class Method Summary collapse
-
.registry ⇒ org.openhab.core.items.MetadataRegistry
The Metadata registry.
Instance Method Summary collapse
-
#remove_item_metadata(item_name) ⇒ void
(also: #removeItemMetadata)
Removes all metadata of a given item.
Methods inherited from Provider
Methods included from Enumerable
#all_groups, #all_members, #command, #command!, #decrease, #down, #equipments, #fast_forward, #groups, #increase, #locations, #member_of, #members, #move, #next, #not_member_of, #not_tagged, #off, #on, #pause, #play, #points, #previous, #refresh, #rewind, #stop, #tagged, #toggle, #up, #update, #update!
Class Method Details
.registry ⇒ org.openhab.core.items.MetadataRegistry
The Metadata registry
19 20 21 |
# File 'lib/openhab/core/items/metadata/provider.rb', line 19 def registry @registry ||= OSGi.service("org.openhab.core.items.MetadataRegistry") end |
Instance Method Details
#remove_item_metadata(item_name) ⇒ void Also known as: removeItemMetadata
This method returns an undefined value.
Removes all metadata of a given item.
34 35 36 37 38 39 40 41 42 |
# File 'lib/openhab/core/items/metadata/provider.rb', line 34 def remove_item_metadata(item_name) @elements.delete_if do |_k, v| next unless v.uid.item_name == item_name notify_listeners_about_removed_element(v) true end nil end |