Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object = {}
- local function Object_create(self, ...)
- local object = self:inherit()
- object:init(...)
- return object
- end
- function Object:inherit()
- local object = {}
- setmetatable(object, { __index = self, __call = Object_create })
- return object
- end
- function Object:is(class)
- return getmetatable(self).__index == class
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement