| 1 | # ABSTRACT: document builder - errors | ||
| 2 | package PONAPI::Document::Builder::Errors; | ||
| 3 | |||
| 4 | 15 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 15 | with 'PONAPI::Document::Builder'; | |
| 7 | |||
| 8 | has _errors => ( | ||
| 9 | init_arg => undef, | ||
| 10 | traits => [ 'Array' ], | ||
| 11 | is => 'ro', | ||
| 12 | isa => 'ArrayRef[ HashRef ]', | ||
| 13 | lazy => 1, | ||
| 14 | 2 | ▶ | default => sub { +[] }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 15 | 15 | handles => { | |
| 16 | 'has_errors' => 'count', | ||
| 17 | # private ... | ||
| 18 | '_add_error' => 'push', | ||
| 19 | } | ||
| 20 | ); | ||
| 21 | |||
| 22 | 7 | ▶ | sub add_error { |
|
Subroutine
add_error: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 23 | 7 | my ( $self, $error ) = @_; | |
| 24 | 7 | $self->_add_error( $error ); | |
| 25 | } | ||
| 26 | |||
| 27 | 14 | ▶ | sub build { |
|
Subroutine
build: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 28 | 14 | my $self = $_[0]; | |
| 29 | 14 | return +[ @{ $self->_errors } ]; | |
| 30 | } | ||
| 31 | |||
| 32 | 15 | __PACKAGE__->meta->make_immutable; | |
| 33 | 15 | ▶ | no Moose; 1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | |||
| 35 | __END__ | ||