File Coverage

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


line stmt bran cond sub pod time code
1             package Moose::Exception::MethodExpectsFewerArgs;
2             our $VERSION = '2.2205';
3              
4 6     6   13929 use Moose;
  6         17  
  6         57  
5             extends 'Moose::Exception';
6              
7             has 'method_name' => (
8             is => 'ro',
9             isa => 'Str',
10             required => 1,
11             );
12              
13             has 'maximum_args' => (
14             is => 'ro',
15             isa => 'Int',
16             required => 1,
17             );
18              
19             sub _build_message {
20 649     649   1129 my $self = shift;
21 649         21116 my $max = $self->maximum_args;
22 649 100       20300 "Cannot call ".$self->method_name." with ".
    100          
23             ( $max ? "more than $max" : 'any'). " argument".( $max == 1 ? '' : 's' );
24             }
25              
26             __PACKAGE__->meta->make_immutable;
27             1;