summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/MethodExpectsMoreArgs.pm
blob: d0e82cf063f8846fbd2e2fc823f9797c65ab8869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package Moose::Exception::MethodExpectsMoreArgs;
our $VERSION = '2.1405';

use Moose;
extends 'Moose::Exception';

has 'method_name' => (
    is       => 'ro',
    isa      => 'Str',
    required => 1
);

has 'minimum_args' => (
    is       => 'ro',
    isa      => 'Int',
    required => 1
);

sub _build_message {
    my $self = shift;
    "Cannot call ".$self->method_name." without at least ".$self->minimum_args." argument".($self->minimum_args == 1 ? '' : 's');
}

1;