object:initialize()

Type Function
Object CoronaPrototype
Library none
Revision 2017.3060

Overview

Subclasses can override this method to provide custom initialization of instances.

Syntax

object:initialize()

Example

local Prototype = require( "CoronaPrototype" )

local MyClass = Prototype:newClass( "MyClass" )

function MyClass:initialize()
    -- custom init
    self.foo = "bar"
    return self
end

local instance = MyClass:new()
print( instance.foo )