Added ldoc comments and slug variable for setup

This commit is contained in:
Skylar Hew
2021-12-16 14:07:58 -07:00
parent 6e02e254aa
commit 0b265d7be5

View File

@@ -1,27 +1,37 @@
--- Template for modules
-- function initiate and table setup are required as a base.
-- @module Template
Template = {}
--- (Required): setup table containing name and description of the module
Module = {} -- @field name "Module Human-Readable Name"
-- @field slug "Template" same as module name
Module.setup = { -- @field desc "Description of the module"
name = "Module Name", Template.setup = {
name = "Module Human-Readable Name",
slug = "Template",
desc = "Description of the module" desc = "Description of the module"
} }
-- defines the input parameters to the module initiate function --- (Optional): config for module
-- when calling a module from within another module -- Defines the input parameters to the module initiate function.
-- variables not defined in config will be ignored -- When calling a module from within another module,
-- default values set in config can be overridden -- variables not defined in config will be ignored.
Module.config = { -- Default values set in config can be overridden
votes_required = 5 -- @field field_1 ex: votes_required, default = 5
voting_type = "majority" -- @field field_2 ex: voting_type, default = "majority"
Template.config = {
field_1 = 5
field_2 = "majority"
} }
-- Modules have access to the following instance variables --- (Required): initiate function
-- self.org (the org the module was called in) -- Modules have access to the following instance variables:
-- self.initiator (the user that callced the module) -- <li><code>self.org</code> (the org the module was called in),</li>
-- self.id (the process id of the module instance) -- <li><code>self.initiator</code> (the user that callced the module),</li>
-- <li><code>self.id</code> (the process id of the module instance)</li>
function Module:initiate(config, result) -- @function initiate
function Template:initiate(config, result)
-- call interaction functions here! -- call interaction functions here!
-- call result function -- call result function