Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function load(class, ...)
- assert(type(class) == "table", "first argument provided to load is not a table")
- local instance = setmetatable( { },
- {
- __index = class;
- __super = { class };
- __newindex = class.__newindex;
- __call = class.__call;
- })
- -- Call load
- if rawget(class, "load") then
- rawget(class, "load")(instance, ...)
- end
- instance.load = false
- return instance
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement