« blib/lib/Moose/Exception/InstanceMustBeABlessedReference.pm
↑ Summary
blib/lib/Moose/Exception/InvalidBaseTypeGivenToCreateParameterizedTypeConstraint.pm »
| 1 | package Moose::Exception::InvalidArgumentsToTraitAliases; | ||
| 2 | 1 | our $VERSION = '2.4001'; | |
| 3 | |||
| 4 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | extends 'Moose::Exception'; | |
| 6 | 1 | with 'Moose::Exception::Role::Class'; | |
| 7 | |||
| 8 | 1 | ▶ | use Scalar::Util qw(reftype); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | has 'alias' => ( | |
| 11 | is => 'ro', | ||
| 12 | isa => 'Any', | ||
| 13 | required => 1 | ||
| 14 | ); | ||
| 15 | |||
| 16 | 1 | has 'package_name' => ( | |
| 17 | is => 'ro', | ||
| 18 | isa => 'Str', | ||
| 19 | required => 1 | ||
| 20 | ); | ||
| 21 | |||
| 22 | 1 | ▶ | sub _build_message { |
|
Subroutine
_build_message: called CC=1 SCAR=0.0
| |||
| 23 | 1 | my $self = shift; | |
| 24 | 1 | my $alias = $self->alias; | |
| 25 | 1 | my $reftype_alias = reftype($alias); | |
| 26 | |||
| 27 | 1 | return "$reftype_alias references are not " | |
| 28 | . "valid arguments to the 'trait_aliases' option"; | ||
| 29 | } | ||
| 30 | |||
| 31 | 1 | __PACKAGE__->meta->make_immutable; | |
| 32 | 1 | 1; | |