Class: OpenHAB::Core::Rules::TaggedArray
- Inherits:
-
Object
- Object
- OpenHAB::Core::Rules::TaggedArray
- Includes:
- LazyArray
- Defined in:
- lib/openhab/core/rules/tagged_array.rb
Overview
Provides access to a set of openHAB rules, and acts like an array.
Instance Method Summary collapse
-
#[](uid) ⇒ Rule?
(also: #include?, #key?, #has_key?)
Gets a specific Rule.
-
#initialize(tag) ⇒ TaggedArray
constructor
A new instance of TaggedArray.
-
#to_a ⇒ Array<Rule>
Explicit conversion to array.
Methods included from LazyArray
#each, #method_missing, #to_ary
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(tag) ⇒ TaggedArray
Returns a new instance of TaggedArray.
14 15 16 |
# File 'lib/openhab/core/rules/tagged_array.rb', line 14 def initialize(tag) @tag = tag end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OpenHAB::Core::LazyArray
Instance Method Details
#[](uid) ⇒ Rule? Also known as: include?, key?, has_key?
Gets a specific Rule
24 25 26 27 |
# File 'lib/openhab/core/rules/tagged_array.rb', line 24 def [](uid) rule = $rules.get(uid) rule.tagged?(@tag) ? rule : nil end |