You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
331 B
Lua
19 lines
331 B
Lua
2 years ago
|
--- @class libmodal.utils.classes
|
||
2 years ago
|
local classes =
|
||
|
{
|
||
|
--- define a metatable.
|
||
|
--- @param template? table the default value
|
||
|
--- @return table class
|
||
|
new = function(template)
|
||
|
-- set self to `template`, or `{}` if nil.
|
||
|
local self = template or {}
|
||
2 years ago
|
|
||
2 years ago
|
-- set `__index`.
|
||
2 years ago
|
self.__index = self
|
||
|
|
||
2 years ago
|
return self
|
||
|
end,
|
||
|
}
|
||
2 years ago
|
|
||
|
return classes
|