NAME

MooseX::Role::REST::Consumer::Response - A simple utility to provide object-oriented return values with messaging

SYNOPSIS

  use MooseX::Role::REST::Consumer::Response

  sub do_something {
      ....

    return MooseX::Role::REST::Consumer::Response->success(
        message => "Everything worked",
    );
  }

  my $response = do_something();
  print "Response: $response\n";
  if (! $response) {
      ...
  }

DESCRIPTION

The Reponse object in this class can be used in boolean or string context and should DWIM.

CLASS METHODS

new (%param)

is_success - Boolean of if success or not
message - Optional text message

Returns blessed object

success (%param)

Takes same parameters as new but implies ( is_success => 1 );

failure (%param)

Similar to success but implies ( is_success => 0 );

OBJECT METHODS

First, some basic Moose attribute accessors:

is_success
error_message

is_failure

Returns boolean

1 POD Error

The following errors were encountered while parsing the POD:

Around line 40:

=cut found outside a pod block. Skipping to next block.