Lib middleclass

Class library.

Functions

class (class[, parent=Object]) Create a new class.


Functions

class (class[, parent=Object])
Create a new class.

Parameters:

  • class string name
  • parent class parent class (default Object)

Returns:

    class new class

Usage:

     local MyParent = class("MyParent")
     function MyParent:shout()
     	print("hello!")
     end
    
     local MyClass = class("MyClass", MyParent)
     local obj = MyClass() -- create an instance of MyClass
     obj:shout() -- prints "hello!"
generated by LDoc 1.4.3 Last updated 2015-04-20 03:01:38