Class: OpenHAB::Core::Items::GroupItem::Members

Inherits:
Object
  • Object
show all
Includes:
LazyArray, DSL::Items::Ensure::Ensurable
Defined in:
lib/openhab/core/items/group_item.rb

Overview

Class for indicating to triggers that a group trigger should be used

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DSL::Items::Ensure::Ensurable

#ensure

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!

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OpenHAB::Core::LazyArray

Instance Attribute Details

#groupGroupItem (readonly)

Returns:



79
80
81
# File 'lib/openhab/core/items/group_item.rb', line 79

def group
  @group
end

Instance Method Details

#inspectString Also known as: to_s

Returns:

  • (String)


101
102
103
104
105
# File 'lib/openhab/core/items/group_item.rb', line 101

def inspect
  r = "#<OpenHAB::Core::Items::GroupItems::Members #{name}"
  r += " #{map(&:name).inspect}>" unless @group.__getobj__.nil?
  "#{r}>"
end

#nameString

Name of the group

Returns:

  • (String)


96
97
98
# File 'lib/openhab/core/items/group_item.rb', line 96

def name
  group.name
end

#to_aArray

Explicit conversion to Array

Returns:



89
90
91
# File 'lib/openhab/core/items/group_item.rb', line 89

def to_a
  group.get_members.map { |i| Proxy.new(i) }
end