Skip to content

Commit

Permalink
docs(pl.class): Clarify what arguments to class constructor are
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Sep 29, 2020
1 parent 90f0bc6 commit b06b02f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lua/pl/class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ end

--- initializes an __instance__ upon creation.
-- @function class:_init
-- @param ... parameters passed to the constructor
-- @param ... input parameters passed to the constructor
-- @usage local Cat = class()
-- function Cat:_init(name)
-- --self:super(name) -- call the ancestor initializer if needed
-- self.name = name
-- end
--
-- local pussycat = Cat("pussycat")
-- print(pussycat.name) --> pussycat
-- local pussycat = Cat("sparkles")
-- print(pussycat.name) --> sparkles

--- checks whether an __instance__ is derived from some class.
-- Works the other way around as `class_of`. It has two ways of using;
Expand Down Expand Up @@ -210,9 +210,9 @@ end
-- The second form creates a variable `Name` in the current environment set
-- to the class, and also sets `_name`.
-- @function class
-- @param base optional base class
-- @param c_arg optional parameter to class constructor
-- @param c optional table to be used as class
-- @param base optional base class to derive from
-- @param c_arg optional parameter passed to class constructor
-- @param c optional table of methods to be used populate the class
local class
class = setmetatable({},{
__call = function(fun,...)
Expand Down

0 comments on commit b06b02f

Please sign in to comment.