Wikia

WoWWiki

Dongle/Module API

Talk0
101,295pages on
this wiki

< Dongle

The Dongle Module system provides a very simple capability for inheritance and ownership within Dongle addons. Each new module is actually a full-fledged dongle object, with the caveat that its initialization and enable functions aren't called until after its parent, and the disable function is called before it's parent.

This API was introduced with Dongle-1.0

DongleObject:NewModule(name[, obj])Edit

Creates a new dongle object, as a module of this DongleObject.

ArgumentsEdit

  • name (string) - The name of the dongle object. This must be a unique name in the global dongle registry.
  • obj (table) - An optional object to use as the base for the new dongle object.

ReturnsEdit

  • obj (table) - The dongle object with all injected functions
  • name (string) - The name of the dongle object

BehaviorEdit

The module will not have its :Intitialize() or :Enable() methods called until DongleObject's methods have been called. The :Disable() method of the module will be called prior to the :Disable() method of the DongleObject.

DongleObject:HasModule(module)Edit

Returns true if the given DongleObject has a module matching the given argument, this can be used to get a module by name.

ArgumentEdit

  • module (string, table) - The name of a module, or the module object itself

ReturnsEdit

  • module if it exists nil otherwise

DongleObject:IterateModules()Edit

ReturnsEdit

  • ModuleIterator (function) - An iterator over the modules of the DongleObject

Iterator ReturnsEdit

  • name (string) - The name of the module
  • obj (table) - The module's object

Around Wikia's network

Random Wiki