summaryrefslogtreecommitdiffhomepage
path: root/libs/core
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-22 14:40:53 +0000
committerSteven Barth <steven@midlink.org>2008-07-22 14:40:53 +0000
commit33b8cf5506ca070862a2bbb13925b0d8f48b138d (patch)
tree6addbce370dfb91e140560484740095ce26a7f00 /libs/core
parentc8e99f87b1d48c263ab945e9d4d8aca349b9cc74 (diff)
libs/core: Add in-line documentation for luci.util.class
Diffstat (limited to 'libs/core')
-rw-r--r--libs/core/luasrc/util.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/core/luasrc/util.lua b/libs/core/luasrc/util.lua
index 443d5f303..c8507798f 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 = {}