Class: CommandFactory

CommandFactory

This class has one static method that returns a new instance of a command.

Constructor

new CommandFactory()

Author:
  • ruckola
Source:

Methods

(static) getCommand(action, commandDir)

Searches the commands directory for a file with a filename that equals the value of the 'action' parameter. If it is found it tries to create a new instance of the command and returns it.
If the the 'action' parameter has value "macro", then the build-in Macro command is returned.

Warning! - Command filepaths must not contain whitespaces!
Parameters:
Name Type Default Description
action String macro The name of the command to return. If no action is given, it returns the Macro command.
commandDir string The directory in which the command can be found. Normally this directory should be specified in the module configuration.
If namespaces are used, they must be included.
Source: