doc: Upgrade the gears.timer documentation to the new standards.

This commit is contained in:
Emmanuel Lepage-Vallee 2019-12-21 21:35:12 -08:00
parent c32c2bf43d
commit 9f42f57a76
1 changed files with 6 additions and 1 deletions

View File

@ -85,6 +85,7 @@ local timer = { mt = {} }
--- Start the timer. --- Start the timer.
-- @method start -- @method start
-- @emits start
function timer:start() function timer:start()
if self.data.source_id ~= nil then if self.data.source_id ~= nil then
gdebug.print_error(traceback("timer already started")) gdebug.print_error(traceback("timer already started"))
@ -99,6 +100,7 @@ end
--- Stop the timer. --- Stop the timer.
-- @method stop -- @method stop
-- @emits stop
function timer:stop() function timer:stop()
if self.data.source_id == nil then if self.data.source_id == nil then
gdebug.print_error(traceback("timer not started")) gdebug.print_error(traceback("timer not started"))
@ -113,6 +115,8 @@ end
-- This is equivalent to stopping the timer if it is running and then starting -- This is equivalent to stopping the timer if it is running and then starting
-- it. -- it.
-- @method again -- @method again
-- @emits start
-- @emits stop
function timer:again() function timer:again()
if self.data.source_id ~= nil then if self.data.source_id ~= nil then
self:stop() self:stop()
@ -128,6 +132,7 @@ end
-- **Signal:** property::timeout -- **Signal:** property::timeout
-- @property timeout -- @property timeout
-- @param number -- @param number
-- @propemits true false
local timer_instance_mt = { local timer_instance_mt = {
__index = function(self, property) __index = function(self, property)
@ -143,7 +148,7 @@ local timer_instance_mt = {
__newindex = function(self, property, value) __newindex = function(self, property, value)
if property == "timeout" then if property == "timeout" then
self.data.timeout = tonumber(value) self.data.timeout = tonumber(value)
self:emit_signal("property::timeout") self:emit_signal("property::timeout", value)
end end
end end
} }