File Coverage

blib/lib/Moose/Exception/AttributeConflictInSummation.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 10 10 100.0


line stmt bran cond sub pod time code
1             package Moose::Exception::AttributeConflictInSummation;
2             our $VERSION = '2.2206';
3              
4 3     3   2444 use Moose;
  3         7  
  3         28  
5             extends 'Moose::Exception';
6             with 'Moose::Exception::Role::Role', 'Moose::Exception::Role::AttributeName';
7              
8             has 'second_role_name' => (
9             is => 'ro',
10             isa => 'Str',
11             required => 1,
12             );
13              
14             sub _build_message {
15 6     6   25 my $self = shift;
16              
17 6         190 my $role1 = $self->role_name;
18 6         207 my $role2 = $self->second_role_name;
19 6         211 my $attr_name = $self->attribute_name;
20              
21 6         179 return "We have encountered an attribute conflict with '$attr_name'"
22             . " during role composition. "
23             . " This attribute is defined in both $role1 and $role2."
24             . " This is a fatal error and cannot be disambiguated.";
25             }
26              
27             __PACKAGE__->meta->make_immutable;
28             1;