MooseX::Role::REST::Consumer::Response - A simple utility to provide object-oriented return values with messaging
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) { ... }
The Reponse object in this class can be used in boolean or string context and should DWIM.
Returns blessed object
Takes same parameters as new but implies ( is_success => 1 );
Similar to success but implies ( is_success => 0 );
First, some basic Moose attribute accessors:
Returns boolean
1 POD Error
The following errors were encountered while parsing the POD:
=cut found outside a pod block. Skipping to next block.
To install MooseX::Role::REST::Consumer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Role::REST::Consumer
CPAN shell
perl -MCPAN -e shell install MooseX::Role::REST::Consumer
For more information on module installation, please visit the detailed CPAN module installation guide.