Lua check if a table is an 'instance'

Viewed 2470

Given a table, is there a way to check if it is an instance object of any class?

Assume all class definition looks like:

Class = {}
Class.__index = Class

function Class.new()
    return setmetatable({}, Class) -- returns an instance
end
2 Answers
Related