PluginInstance class
PluginInstance is the object that represents a single plugin, or the schema.
Plugin.include creates one for every plugin with the info from its plugin.yml and
exposes it as the PLUGIN global while the plugin's files are included; the schema's
instance is the SCHEMA global. The functions a plugin defines on this object become its
hook handlers once it is registered. The setters are meant to be called from the plugin's
main file, and PluginInstance:set_global gives the plugin a global name of its own.
Summary
Methods
Methods
Converts the plugin to a string of the form '#Plugin:name'.
Returns
- String
Returns the author of the plugin.
Returns
- String
Returns the description of the plugin.
Returns
- String
Returns the folder that contains the plugin's code.
Returns
- String
Returns the name of the plugin.
Returns
- String
Returns the path the plugin was included from. Plugins are stored under this path.
Returns
- String
Class constructor. Fills in the basic plugin fields, then merges the whole data table into the object.
Parameters
- id String plugin ID; data.id is used if this is nil
- data Map plugin info with name, author, folder, path, description and any additional fields
Checks whether this plugin object is the schema.
Returns
- Boolean true for the schema, nil for regular plugins
Registers the plugin with the Plugin library.
See also
Sets the author of the plugin.
Parameters
- author String new author; the current author is kept if this is nil
Merges the fields of a table into the plugin object.
Parameters
- data Map fields to merge
Sets the description of the plugin.
Parameters
- desc String new description; the current description is kept if this is nil
Makes the plugin available as a global variable, unless a global table with that name already exists. Throws an error if the name starts with a lowercase letter.
Parameters
- alias String name of the global, in ConstantStyle
Sets the name of the plugin.
Parameters
- name String new name; the current name is kept if this is nil