Awesome
Lowerclass
A simple OOP library for Lua. It has inheritance and metamethods (operators). It uses the same API as Middleclass (with some small differences) but tries to be small and fast.
Note: For an even smaller class library take a look at this Gist
Documentation
As said before, this library shares the same API as Middleclass, with some differences.
This means that you can take a look at the Middleclass wiki for examples & documentation.
While taking into account the next few differences:
static
methods are not supported.__index
metamethod is not supported, changing it may create errors.allocate
is not part of the class, instead a private function is used.- Mixins are not supported so
include
is not supported. Child.subclasses
are currently commented out to keep the simplicity, they could easily be added.- Metamethods are not inherited (Issue #1)
Installation
Just copy the lowerclass.lua
file wherever you want it (for example on a lib/ folder). Then write this in any Lua file where you want to use it:
local class = require 'lowerclass'
More
Check the spec
folder for info on the spec.
Check the performance
folder for info on the performance tests.
License
Lowerclass is distributed under the MIT license.