diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/core/luasrc/util.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/core/luasrc/util.lua b/libs/core/luasrc/util.lua index 443d5f3032..c8507798f3 100644 --- a/libs/core/luasrc/util.lua +++ b/libs/core/luasrc/util.lua @@ -27,7 +27,20 @@ limitations under the License. module("luci.util", package.seeall) --- Lua simplified Python-style OO class support emulation +--- Creates a Class object (Python-style object model) +-- Creates a new class object which can be instantiated by calling itself. +-- Any class functions or shared parameters can be attached to this object. +-- Attaching a table to the class object makes this table shared between +-- all instances of this class. For object paramters use the __init__ function. +-- Classes can inherit member functions and values from a base class. +-- Class can be instantiated by calling them. All parameters will be passed +-- to the __init__ function of this class - if such a function exists. +-- The __init__ function must be used to set any object parameters that are not shared +-- with other objects of this class. Any return values will be ignored. +-- @see instanceof +-- @see clone +-- @param base the base class to inherit from (optional) +-- @return class object function class(base) local class = {} |