File Coverage

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


line stmt bran cond sub pod time code
1             package Moose::Exception::CannotCoerceAttributeWhichHasNoCoercion;
2             our $VERSION = '2.2203';
3              
4 3     3   1544 use Moose;
  3         6  
  3         18  
5             extends 'Moose::Exception';
6             with 'Moose::Exception::Role::InvalidAttributeOptions', 'Moose::Exception::Role::TypeConstraint';
7              
8             sub _build_message {
9 4     4   9 my $self = shift;
10 4         129 my $name = $self->attribute_name;
11 4         110 my $type = $self->type_name;
12              
13 4         87 return "You cannot coerce an attribute ($name) unless its type ($type) has a coercion";
14             }
15              
16             __PACKAGE__->meta->make_immutable;
17             1;