Class: List
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/lights/list.rb
Direct Known Subclasses
BulbList, GroupList, RuleList, SceneList, ScheduleList, SensorList, UserList
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(data = {}) ⇒ List
constructor
A new instance of List.
Methods inherited from HObject
Constructor Details
#initialize(data = {}) ⇒ List
Returns a new instance of List.
11 12 13 |
# File 'lib/lights/list.rb', line 11 def initialize(data = {}) @list = [] end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
10 11 12 |
# File 'lib/lights/list.rb', line 10 def list @list end |
Instance Method Details
#data ⇒ Object
15 16 17 18 19 |
# File 'lib/lights/list.rb', line 15 def data data = {} @list.each {|b| data[b.id] = b.data} if @list data end |