dcsext.overrideOps
OverrideOps - override metamethods of a class after creation.
Contents
Description
Useful to swap or extend class behavior at runtime without touching the class definition itself.
Functions
overrideOps(cls, mt)
Merge the methods defined in mt over the metatable of cls.
Parameters
- cls
- a class created by dcsext.class.
- mt
- table of metamethod implementations merged over the class metatable(cls.__mt), entries in mt win over existing ones.
Returns
- cls so calls can be chained.