Class: OpenHAB::Core::Sitemaps::Provider
- Inherits:
-
Provider
- Object
- org.openhab.core.common.registry.AbstractProvider
- Provider
- OpenHAB::Core::Sitemaps::Provider
- Defined in:
- lib/openhab/core/sitemaps/provider.rb
Overview
Provides sitemaps created in Ruby to openHAB
Instance Method Summary collapse
-
#build(update: true) { ... } ⇒ void
Enter the Sitemap Builder DSL.
-
#remove(sitemap_name) ⇒ Boolean
Remove a sitemap.
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!
Instance Method Details
#build(update: true) { ... } ⇒ void
This method returns an undefined value.
Enter the Sitemap Builder DSL.
130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/openhab/core/sitemaps/provider.rb', line 130 def build(update: true, &block) builder_proxy = SimpleDelegator.new(nil) if block.arity == 1 builder = DSL::Sitemaps::Builder.new(self, builder_proxy, update: update) if block.arity == 1 builder_proxy.__setobj__(builder) DSL::ThreadLocal.thread_local(openhab_create_dummy_items: true) do yield builder_proxy end else builder.instance_eval(&block) end end |
#remove(sitemap_name) ⇒ Boolean
Remove a sitemap.
158 159 160 |
# File 'lib/openhab/core/sitemaps/provider.rb', line 158 def remove(sitemap_name) super("#{PREFIX}#{sitemap_name}#{SUFFIX}") end |