Skip to content
Roland edited this page Sep 27, 2016 · 1 revision

30log provides a set of built-in functions to inspect relationships between classes and instances.

class.isClass(class)

This library function returns true when the given argument is a class.

local aClass = class()
local aTable = {}
print(class.isClass(aClass)) -- outputs true
print(class.isClass(aTable)) -- outputs false

class.isInstance(instance)

This library function returns true when the given argument is an instance from any class.

local aClass = class()
local instance = aClass()
local sometable = {}
print(class.isInstance(instance)) -- outputs true
print(class.isInstance(sometable)) -- outputs false