Class: HueConfig
- Inherits:
-
Object
- Object
- HueConfig
- Defined in:
- lib/lights/config.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#swversion ⇒ Object
readonly
Returns the value of attribute swversion.
-
#whitelist ⇒ Object
readonly
Returns the value of attribute whitelist.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(data = {}) ⇒ HueConfig
constructor
A new instance of HueConfig.
- #to_json(options = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def name @name end |
#swversion ⇒ Object (readonly)
Returns the value of attribute swversion.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def swversion @swversion end |
#whitelist ⇒ Object (readonly)
Returns the value of attribute whitelist.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def whitelist @whitelist end |
Instance Method Details
#data ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/lights/config.rb', line 14 def data data = @data data["name"] = @name if @name data["swversion"] = @swversion if @swversion data["whitelist"] = @whitelist.data if !@whitelist.data.empty? data end |
#to_json(options = {}) ⇒ Object
22 23 24 |
# File 'lib/lights/config.rb', line 22 def to_json(={}) data.to_json end |