Suppose I have a function that returns a closure:
--- Agent constructor
-- @return A function describing the behavior of the agent
Agent = function(data)
return function(arg1, arg2, ...) end
end
And then I have a variable that receives that closure:
SugarAgent = Agent{ metabolism=5, health=3 }
Is there a standard way in LuaDoc to document the above construction?
You can do it by specifying the doc name and type manually:
--- This is a SugarAgent
-- @name SugarAgent
-- @class function
-- @return Some value
SugarAgent = Agent{ metabolism=5, health=3 }