Class: OpenHAB::Core::Things::Thing::ChannelsArray
- Defined in:
 - lib/openhab/core/things/thing.rb
 
Overview
Array wrapper class to allow searching a list of channels by channel id
Instance Method Summary collapse
- 
  
    
      #[](index)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Allows indexing by both integer as an array or channel id acting like a hash.
 
Methods inherited from Array
Instance Method Details
#[](index) ⇒ Object
Allows indexing by both integer as an array or channel id acting like a hash.
      46 47 48 49 50 51 52 53  | 
    
      # File 'lib/openhab/core/things/thing.rb', line 46 def [](index) if index.respond_to?(:to_str) key = index.to_str return find { |channel| channel.uid.id == key } end super end  |