classic icon indicating copy to clipboard operation
classic copied to clipboard

Hide meta methods

Open Shadowblitz16 opened this issue 4 years ago • 0 comments

Consider hiding the meta methods. Maybe something like this..

local Object   = {}
local Meta     =
{
	__call  = function(self, ...)
		local obj = setmetatable({}, self)
		obj:new(...)
		return obj
	end,
	
	__tostring = function(self)
	  return "Object"
	end,
	
	__index = Object
}
setmetatable(Object, Meta)

Shadowblitz16 avatar Dec 19 '21 05:12 Shadowblitz16