Class: List

Inherits:
HObject show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/lights/list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HObject

#to_json

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

#listObject (readonly)

Returns the value of attribute list.



10
11
12
# File 'lib/lights/list.rb', line 10

def list
  @list
end

Instance Method Details

#dataObject



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