Home

Awesome

LowerClass

A simple OOP library for Lua. It has complex inheritance, metamethod support, and weak mixin support.

[!NOTE] This is heavily inspired by middleclass by kikito. Many parts of the code are directly copied, and the core functionallity is modeled after it. I love MiddleClass but found a few features limiting, hence why LowerClass was developed. All changes can be found here

Quick Look

local class = require 'lowerclass'

local Fruit = class('fruit')

function Fruit:__init(sweetness)
  self.sweetness = sweetness
end

local Colorful = class('colorful')

function Colorful:__init(color)
  self.color = color
end

local Lemon = class('Lemon', Fruit, Colorful)

function Lemon:__init(color, sweetness)
  Fruit.__init(self, sweetness)
  Colorful.__init(self, color)
end

local lemon = Lemon:new('blue', 10)

Quick Docs

LowerClass

Class

Instance