Created
December 23, 2010 16:35
-
-
Save melo/753218 to your computer and use it in GitHub Desktop.
How to use Moose attribute traits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################## | |
| # Error management | |
| has 'errors' => ( | |
| traits => ['Hash'], | |
| is => 'bare', | |
| isa => 'HashRef', | |
| default => sub { {} }, | |
| handles => { | |
| add_error => 'set', | |
| error_for => 'get', | |
| has_errors => 'count', | |
| errors => 'kv', | |
| clear_errors => 'clear', | |
| }, | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment