Product Site

5.1.4.19. run (Private Method)

Runs method, which can be either
  • a method object, or
  • a string containing a method source line, or an Array of strings containing individual method source lines (for these cases an equivalent method object is created).

The method has access to the object variables of the receiver object, as if the receiver object had defined the method by using setMethod.

If you specify neither Individual nor Array, the method runs without arguments.

If you specify the Individual or Array option, any remaining arguments are arguments for the method. (You need to specify only the first letter; all characters following the first character are ignored.)
Individual

Passes any remaining arguments to the method as arguments in the order you specify them.
Array

Requires arguments, which is an Array object. The member items of the array are passed to the method as arguments. The first argument is at index 1, the second argument at index 2, and so on. If you omitted any indexes when creating the array, the corresponding arguments are omitted when passing the arguments.

Notes:
  1. The run method is a private method (see Section 4.2.8, “Public, Package-Scope, and Private Methods”) with the additional restriction that it can only be called
    • from an instance method of the receiving object itself, or
    • from a class method in the receiving object's inheritance chain.
  2. The run method is a protected method.