Class: Schedule
- Inherits:
-
Object
- Object
- Schedule
- Defined in:
- lib/lights/schedule.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(id, data = {}) ⇒ Schedule
constructor
A new instance of Schedule.
- #scene ⇒ Object
- #to_json(options = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/lights/schedule.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/lights/schedule.rb', line 4 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/lights/schedule.rb', line 4 def status @status end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/lights/schedule.rb', line 4 def time @time end |
Instance Method Details
#data ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/lights/schedule.rb', line 18 def data data = @data data["name"] = @name if @name data["time"] = @time if @time data["status"] = @status if @status data["command"] = @command.data if !@command.data.empty? data end |
#scene ⇒ Object
14 15 16 |
# File 'lib/lights/schedule.rb', line 14 def scene @command.body["scene"] end |
#to_json(options = {}) ⇒ Object
27 28 29 |
# File 'lib/lights/schedule.rb', line 27 def to_json(={}) data.to_json end |