« blib/lib/Moose/Exception/CreateTakesHashRefOfMethods.pm
↑ Summary
blib/lib/Moose/Exception/DelegationToAClassWhichIsNotLoaded.pm »
| 1 | package Moose::Exception::DefaultToMatchOnTypeMustBeCodeRef; | ||
| 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 | |||
| 7 | 1 | has 'to_match' => ( | |
| 8 | is => 'ro', | ||
| 9 | isa => 'Any', | ||
| 10 | required => 1 | ||
| 11 | ); | ||
| 12 | |||
| 13 | 1 | has 'default_action' => ( | |
| 14 | is => 'ro', | ||
| 15 | isa => 'Any', | ||
| 16 | required => 1 | ||
| 17 | ); | ||
| 18 | |||
| 19 | 1 | has 'cases_to_be_matched' => ( | |
| 20 | is => 'ro', | ||
| 21 | isa => 'ArrayRef', | ||
| 22 | required => 1 | ||
| 23 | ); | ||
| 24 | |||
| 25 | 1 | ▶ | sub _build_message { |
|
Subroutine
_build_message: called CC=1 SCAR=0.0
| |||
| 26 | 1 | my $self = shift; | |
| 27 | 1 | my $default = $self->default_action; | |
| 28 | |||
| 29 | 1 | return "Default case must be a CODE ref, not $default"; | |
| 30 | } | ||
| 31 | |||
| 32 | 1 | __PACKAGE__->meta->make_immutable; | |
| 33 | 1 | 1; | |