Class: Group

Inherits:
HObject show all
Defined in:
lib/lights/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HObject

#to_json

Constructor Details

#initialize(id = nil, data = {}) ⇒ Group

Returns a new instance of Group.



6
7
8
9
10
11
12
# File 'lib/lights/group.rb', line 6

def initialize( id = nil, data = {} )
  @id = id
  @action = BulbState.new(data["action"]) 
  @name = data["name"]
  @lights = data["lights"]
  @type = data["type"]
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



4
5
6
# File 'lib/lights/group.rb', line 4

def action
  @action
end

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/lights/group.rb', line 4

def data
  @data
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/lights/group.rb', line 4

def id
  @id
end

#lightsObject

Returns the value of attribute lights.



4
5
6
# File 'lib/lights/group.rb', line 4

def lights
  @lights
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/lights/group.rb', line 4

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/lights/group.rb', line 4

def type
  @type
end