class

Spectator::ExampleGroupHook

Inherits Reference / Object

Information about a hook tied to an example group and a proc to invoke it.

Constructors

new(proc : -> , *, location : Location | Nil = nil, label : Label = nil)

Creates the hook with a proc. The proc will be called when the hook is invoked. A location and label can be provided for debugging.

Source
new(*, location : Location | Nil = nil, label : Label = nil, &block : -> _)

Creates the hook with a block. The block will be executed when the hook is invoked. A location and label can be provided for debugging.

Source

Instance methods

call

Invokes the hook.

Source
call_once

Invokes the hook if it hasn't already been invoked. Returns true if the hook was invoked (first time being called).

Source
label

User-defined description of the hook.

Source
label?

User-defined description of the hook.

Source
location

Location of the hook in source code.

Source
location?

Location of the hook in source code.

Source
to_s(io : IO) : Nil

Produces the string representation of the hook. Includes the location and label if they're not nil.

Source