MooseX::Exception::Base::Stringify - Traits class for attributes that are to be stringified.
This documentation refers to MooseX::Exception::Base::Stringify version 0.0.3.
use Moose; use MooseX::Exception::Base::Stringify; # cause a MooseX::Exception::Base to output this value has my_attrib => ( is => 'rw', isa => 'Str', traits => [qw{MooseX::Exception::Stringify}], ); # custom stringification from an object has my_date => ( is => 'rw', isa => 'DateTime', traits => [qw{MooseX::Exception::Stringify}], stringify => sub {$_->ymd}, ); # causes the stringified object to show the my_message value # something like 'Message : ' . $obj->my_message has my_message => ( is => 'rw', isa => 'Str', traits => [qw{MooseX::Exception::Stringify}], stringify_pre => 'Message : ', ); # like with stringify_pre the value has stringify_post appended # $obj->my_post . ' km/h' has my_post => ( is => 'rw', isa => 'Num', traits => [qw{MooseX::Exception::Stringify}], stringify_post => ' km/h', );
Defines the trait (MooseX::Exception::Stringify) for MooseX::Exception::Base objects that want other parameters to be stringified along with the error object.
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
Ivan Wills - (ivan.wills@gmail.com)
Copyright (c) 2012 Ivan Wills (14 Mullion Close Hornsby Heights NSW Australia 2077). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install MooseX::Exception::Base, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Exception::Base
CPAN shell
perl -MCPAN -e shell install MooseX::Exception::Base
For more information on module installation, please visit the detailed CPAN module installation guide.