Created
January 22, 2013 02:51
-
-
Save cheald/4591677 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Prototype = {} | |
local Prototype_mt = {__index = Prototype} | |
function Prototype.do_stuff(times) | |
-- Do stuff | |
end | |
function Prototype:new() | |
local new_inst = {} -- the new instance | |
setmetatable( new_inst, Prototype_mt ) -- all instances share the same metatable | |
return new_inst | |
end | |
Prototype:new():do_stuff(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment