2 -- classic, object model.
4 -- Copyright (c) 2014, rxi
6 -- This module is free software; you can redistribute it and/or modify it under
7 -- the terms of the MIT license. See LICENSE for details.
9 -- Base object model used with Kong, see [classic github repo](https://github.com/rxi/classic) for usage information
12 Object.__index = Object
19 function Object:extend()
21 for k, v in pairs(self) do
22 if k:find("__") == 1 then
28 setmetatable(cls, self)
33 function Object:implement(...)
34 for _, cls in pairs({...}) do
35 for k, v in pairs(cls) do
36 if self[k] == nil and type(v) == "function" then
45 local mt = getmetatable(self)
56 function Object:__tostring()
61 function Object:__call(...)
62 local obj = setmetatable({}, self)