Module Spy

Class for spies.

Functions

spy:__call () Instance is callable.
spy:eval () Evaluate graph.
spy:addCallback () Add a callback.
spy:log () Log a traceback.
spy:raise () Rise an exception.
spy.new () Create a new instance.
spy.newCarp () Create a new carp instance.
spy.newCluck () Create a new cluck instance.
spy.newCroak () Create a new croak instance.
spy.newConfess () Create a new confess instance.


Functions

spy:__call ()
Instance is callable. This call may not return at all. Redirects to objects eval method.

Parameters:

  • text string for a last minute message

Returns:

self
spy:eval ()
Evaluate graph.

Parameters:

  • text nil or string to be reported on evaluation of the compute grap

Returns:

nil or string zero or more strings
spy:addCallback ()
Add a callback. The function is expected to have a signature on the form function( table, ... ) where the table is a list of strings. It may change the content of the table.

Parameters:

  • func function to be registered on the compute graph.
  • index nil or number to inject the callbak

Returns:

self
spy:log ()
Log a traceback.

Parameters:

  • text nil or string to be reported on evaluation of the compute grap
  • level nil or number to start reporting

Returns:

self
spy:raise ()
Rise an exception. The Scribunto implementation makes it difficult to do this correctly.

Parameters:

  • text nil or string to be reported on evaluation of the compute grap
  • level nil or number to start reporting

Returns:

self
spy.new ()
Create a new instance.

Parameters:

  • ... vararg arguments to be passed on

Returns:

self
spy.newCarp ()
Create a new carp instance. This convenience function register a log callback.

Parameters:

  • ... vararg arguments to be passed on

Returns:

self
spy.newCluck ()
Create a new cluck instance. This convenience function register a log callback.

Parameters:

  • ... vararg arguments to be passed on

Returns:

self
spy.newCroak ()
Create a new croak instance. This convenience function register a raise callback. The Scribunto implementation makes it difficult to do this correctly.

Parameters:

  • ... vararg arguments to be passed on

Returns:

self

Raises:

unconditionally
spy.newConfess ()
Create a new confess instance. This convenience function register a raise callback. The Scribunto implementation makes it difficult to do this correctly.

Parameters:

  • ... vararg arguments to be passed on

Returns:

self

Raises:

unconditionally
generated by LDoc TESTING