class Schedule
Attributes
command[R]
created[R]
description[R]
id[R]
local_time[R]
name[R]
status[R]
time[R]
Public Class Methods
new(id,data = {})
click to toggle source
# File lib/lights/schedule.rb, line 8 def initialize(id,data = {}) @id = id @name = data["name"] @time = data["time"] @status = data["status"] @description = data["description"] @local_time = data["localtime"] @created = data["created"] @command = Command.new(data["command"]) end
Public Instance Methods
data()
click to toggle source
# File lib/lights/schedule.rb, line 23 def data data = {} data["name"] = @name if @name data["time"] = @time if @time data["status"] = @status if @status data["description"] = @description if @description data["localtime"] = @local_time if @local_time data["created"] = @created if @created data["command"] = @command.data unless @command.data.empty? data end
scene()
click to toggle source
# File lib/lights/schedule.rb, line 19 def scene @command.body["scene"] end