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.2206';
3              
4 3     3   1820 use Moose;
  3         10  
  3         21  
5             extends 'Moose::Exception';
6             with 'Moose::Exception::Role::InvalidAttributeOptions', 'Moose::Exception::Role::TypeConstraint';
7              
8             sub _build_message {
9 4     4   18 my $self = shift;
10 4         177 my $name = $self->attribute_name;
11 4         143 my $type = $self->type_name;
12              
13 4         111 return "You cannot coerce an attribute ($name) unless its type ($type) has a coercion";
14             }
15              
16             __PACKAGE__->meta->make_immutable;
17             1;