File Coverage

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


line stmt bran cond sub pod time code
1             package Moose::Exception::NeedsTypeConstraintUnionForTypeCoercionUnion;
2             our $VERSION = '2.2203';
3              
4 1     1   432 use Moose;
  1         3  
  1         6  
5             extends 'Moose::Exception';
6             with 'Moose::Exception::Role::TypeConstraint';
7              
8             # use Moose::Util::TypeConstraints 'find_type_constraint';
9              
10             has 'type_coercion_union_object' => (
11             is => 'ro',
12             isa => 'Moose::Meta::TypeCoercion::Union',
13             required => 1
14             );
15              
16             sub _build_message {
17 1     1   2 my $self = shift;
18 1         30 my $type_constraint = $self->type_name;
19              
20 1         22 return "You can only create a Moose::Meta::TypeCoercion::Union for a " .
21             "Moose::Meta::TypeConstraint::Union, not a $type_constraint"
22             }
23              
24             __PACKAGE__->meta->make_immutable;
25             1;