File Coverage

blib/lib/Moose/Exception/RequiredMethodsNotImplementedByClass.pm
Criterion Covered Total %
statement 9 9 100.0
branch 2 2 100.0
condition n/a
subroutine 2 2 100.0
pod n/a
total 13 13 100.0


line stmt bran cond sub pod time code
1             package Moose::Exception::RequiredMethodsNotImplementedByClass;
2             our $VERSION = '2.2205';
3              
4 6     6   3735 use Moose;
  6         18  
  6         52  
5             extends 'Moose::Exception';
6             with 'Moose::Exception::Role::Class', 'Moose::Exception::Role::Role';
7              
8             has 'missing_methods' => (
9             traits => ['Array'],
10             is => 'ro',
11             isa => 'ArrayRef[Moose::Meta::Role::Method::Required]',
12             handles => { method_count => 'count',
13             get_method_at => 'get',
14             get_all_methods => 'elements',
15             },
16             required => 1
17             );
18              
19             sub _build_message {
20 16     16   41 my $self = shift;
21              
22 16 100       746 my $noun = $self->method_count == 1 ? 'method' : 'methods';
23 16         798 my $list = Moose::Util::english_list( map { q{'} . $_ . q{'} } $self->get_all_methods );
  24         118  
24 16         616 my ($role_name, $class_name) = ($self->role_name, $self->class_name);
25              
26 16         455 return "'$role_name' requires the $noun $list "
27             . "to be implemented by '$class_name'";
28             }
29              
30             __PACKAGE__->meta->make_immutable;
31             1;