This method casts the object to a derived type.
function As<T>()
Parameter
Returns
Returns the object as a derived type T, or nil
if the object cannot be cast to the specified type.
This method should never be called in a class constructor or destructor.
-- Cast to base type
local o = CreateBuffer()
-- Cast to derived type
local buffer = o:As<Buffer>()