« blib/lib/Moose/Exception/InvalidArgumentToMethod.pm
↑ Summary
blib/lib/Moose/Exception/RoleExclusionConflict.pm »
| 1 | package Moose::Exception::MethodExpectsFewerArgs; | ||||||||||||||
| 2 | 6 | our $VERSION = '2.4001'; | |||||||||||||
| 3 | |||||||||||||||
| 4 | 6 | ▶ | use Moose; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 6 | extends 'Moose::Exception'; | |||||||||||||
| 6 | |||||||||||||||
| 7 | 6 | has 'method_name' => ( | |||||||||||||
| 8 | is => 'ro', | ||||||||||||||
| 9 | isa => 'Str', | ||||||||||||||
| 10 | required => 1, | ||||||||||||||
| 11 | ); | ||||||||||||||
| 12 | |||||||||||||||
| 13 | 6 | has 'maximum_args' => ( | |||||||||||||
| 14 | is => 'ro', | ||||||||||||||
| 15 | isa => 'Int', | ||||||||||||||
| 16 | required => 1, | ||||||||||||||
| 17 | ); | ||||||||||||||
| 18 | |||||||||||||||
| 19 | 649 | ▶ | sub _build_message { | ||||||||||||
|
Subroutine
_build_message: called CC=3 SCAR=11.0
| |||||||||||||||
| 20 | 649 | my $self = shift; | |||||||||||||
| 21 | 649 | my $max = $self->maximum_args; | |||||||||||||
| 22 | 649 | ▶ | "Cannot call ".$self->method_name." with ". | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 23 | ( $max ? "more than $max" : 'any'). " argument".( $max == 1 ? '' : 's' ); | ||||||||||||||
| 24 | } | ||||||||||||||
| 25 | |||||||||||||||
| 26 | 6 | __PACKAGE__->meta->make_immutable; | |||||||||||||
| 27 | 6 | 1; | |||||||||||||