summaryrefslogtreecommitdiff
path: root/Data/Libraries/LDoc/tests/factory
diff options
context:
space:
mode:
Diffstat (limited to 'Data/Libraries/LDoc/tests/factory')
-rw-r--r--Data/Libraries/LDoc/tests/factory/factory.lua51
-rw-r--r--Data/Libraries/LDoc/tests/factory/mymod.lua21
2 files changed, 72 insertions, 0 deletions
diff --git a/Data/Libraries/LDoc/tests/factory/factory.lua b/Data/Libraries/LDoc/tests/factory/factory.lua
new file mode 100644
index 0000000..e620ee0
--- /dev/null
+++ b/Data/Libraries/LDoc/tests/factory/factory.lua
@@ -0,0 +1,51 @@
+---
+-- Useful classes.
+-- This is the enclosing module description.
+
+--- My class.
+-- Describe our class
+-- @factory Object
+
+local make_object
+do
+ --- my private method
+ -- document here. (By default it will not show in docs.)
+ -- @private
+ local my_private_method = function(self)
+ ...more code here...
+ end
+
+ --- my public method.
+ -- documentation here
+ -- @param arg
+ local method = function(self, arg)
+ .....some code here.....
+ return my_private_method(self)
+ end
+
+ --- Another public method.
+ -- More details
+ local more = function(self)
+ end
+
+ --- factory returning @{Object}.
+ -- @constructor
+ -- @param arg
+ -- @param arg2
+ make_object = function(arg, arg2)
+ return
+ {
+ -- private fields
+ field_ = arg;
+
+ -- public methods
+ method = method;
+ more = more;
+ }
+ end
+end
+
+return {
+ make_object = make_object
+}
+
diff --git a/Data/Libraries/LDoc/tests/factory/mymod.lua b/Data/Libraries/LDoc/tests/factory/mymod.lua
new file mode 100644
index 0000000..d872047
--- /dev/null
+++ b/Data/Libraries/LDoc/tests/factory/mymod.lua
@@ -0,0 +1,21 @@
+--- mymod
+
+local mymod = {}
+
+--- everything!
+function mymod.query (
+ a, --string: first arg
+ b, --int: second arg
+ c --table: arg
+)
+end
+
+
+--- for everything.
+function mymod.answer (
+ a, -- first arg
+ b, -- second arg
+ c) -- third arg
+end
+
+return mymod