NAME

App::Spec::Run::Response - Response class for App::Spec::Run

METHODS

add_output

If you pass it a string, it will create a App::Spec::Run::Output.

    $res->add_output("string\n", "string2\n");
    my $output = App::Spec::Run::Output->new(
        content => "string\n",
    );
    $res->add_output($output);

This will call print_output if buffered is false, otherwise it will add the output to outputs

add_error

Like add_output, but the created Output object will have an attribute error set to 1.

    $res->add_error("string\n", "string2\n");
    my $output = App::Spec::Run::Output->new(
        error => 1,
        content => "string\n",
    );
    $res->add_error($output);
    $res->print_output(@out);

Prints the given output and all output in outputs.

add_callbacks
    $response->add_callbacks(print_output => \@callbacks);

Where @callbacks are coderefs.

ATTRIBUTES

buffered

If true, output should be buffered until print_output is called.

Default: false

exit

The exit code

outputs

Holds an array of App::Spec::Run::Output objects.

finished

Set to 1 after print_output has been called.

halted

If set to 1, no further processing should be done.

callbacks

Contains a hashref of callbacks

    {
        print_output => $coderef,
    },