Base class implementation for Lua
You can:
- clone the repository:
git clone https://github.com/a1div0/lua-object.git- install the
lua-objectmodule usingtarantoolctl:
tarantoolctl rocks install https://raw.githubusercontent.com/a1div0/lua-object/main/lua-object-1.0.3-1.rockspeclocalObject=require('lua-object')
localNewClass=Object:extend()
localNewClassChild=NewClass:extend()localobj=NewClass:new(a, b, c...)functionNewClass:initialize(a, b, c...)
---endinitialize - is key word
functionNewClass:method1(a, b, c...)
---endfunctionNewClassChild:method1(a, b, c...)
---NewClass.method1(self, a, b, c...)
---endifobj.myInstance(NewClass) then---endlocalObject=require('lua-object')
localBaseTable=Object:extend()
functionBaseTable:myFunction1(arg1, arg2, arg3)
---- ...--endlocaltableA=BaseTable:new()
iftableA:isInstance(Object) thentableA:myFunction1(1, 2, 3)
end