libs/core: Add in-line documentation for luci.util.class
authorSteven Barth <steven@midlink.org>
Tue, 22 Jul 2008 14:40:53 +0000 (14:40 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 22 Jul 2008 14:40:53 +0000 (14:40 +0000)
libs/core/luasrc/util.lua

index 443d5f3..c850779 100644 (file)
@@ -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 = {}