Class: Scene
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lights ⇒ Object
Returns the value of attribute lights.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(id, data = {}) ⇒ Scene
constructor
A new instance of Scene.
Methods inherited from HObject
Constructor Details
#initialize(id, data = {}) ⇒ Scene
Returns a new instance of Scene.
5 6 7 8 9 10 |
# File 'lib/lights/scene.rb', line 5 def initialize(id,data = {}) @id = id @name = data["name"] @active = data["active"] @lights = data["lights"] end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
4 5 6 |
# File 'lib/lights/scene.rb', line 4 def active @active end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/lights/scene.rb', line 4 def id @id end |
#lights ⇒ Object
Returns the value of attribute lights.
4 5 6 |
# File 'lib/lights/scene.rb', line 4 def lights @lights end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/lights/scene.rb', line 4 def name @name end |
Instance Method Details
#data ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lights/scene.rb', line 12 def data data = {} data["name"] = @name if @name data["active"] = @active unless @active.nil? data["lights"] = @lights if @lights data end |