Class: OpenHAB::Core::Items::Provider
- Inherits:
-
Provider
- Object
- org.openhab.core.common.registry.AbstractProvider
- Provider
- OpenHAB::Core::Items::Provider
- Defined in:
- lib/openhab/core/items/provider.rb
Overview
Provides Items created in Ruby to openHAB
Class Method Summary collapse
-
.registry ⇒ org.openhab.core.items.ItemRegistry
The Item registry.
Instance Method Summary collapse
-
#initialize ⇒ Provider
constructor
A new instance of Provider.
-
#remove(item_name, recursive = false) ⇒ Item?
Remove an item from this provider.
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!
Constructor Details
#initialize ⇒ Provider
Returns a new instance of Provider.
38 39 40 |
# File 'lib/openhab/core/items/provider.rb', line 38 def initialize super(unload_priority: 50) end |
Class Method Details
.registry ⇒ org.openhab.core.items.ItemRegistry
The Item registry
18 19 20 |
# File 'lib/openhab/core/items/provider.rb', line 18 def registry $ir end |
Instance Method Details
#remove(item_name, recursive = false) ⇒ Item?
Remove an item from this provider
30 31 32 33 34 35 36 |
# File 'lib/openhab/core/items/provider.rb', line 30 def remove(item_name, recursive = false) # rubocop:disable Style/OptionalBooleanParameter matches Java method return nil unless @elements.key?(item_name) item = super(item_name) item.members.each { |member| remove(member.name, true) } if recursive && item.is_a?(GroupItem) item end |