« blib/lib/Moose/Exception/AttributeNamesDoNotMatch.pm
↑ Summary
blib/lib/Moose/Exception/AttributeValueIsNotDefined.pm »
| 1 | package Moose::Exception::AttributeValueIsNotAnObject; | ||
| 2 | 2 | our $VERSION = '2.4001'; | |
| 3 | |||
| 4 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | extends 'Moose::Exception'; | |
| 6 | 2 | with 'Moose::Exception::Role::Instance', 'Moose::Exception::Role::Attribute'; | |
| 7 | |||
| 8 | 2 | has 'method' => ( | |
| 9 | is => 'ro', | ||
| 10 | isa => 'Moose::Meta::Method::Delegation', | ||
| 11 | required => 1, | ||
| 12 | ); | ||
| 13 | |||
| 14 | 2 | has 'given_value' => ( | |
| 15 | is => 'ro', | ||
| 16 | isa => 'Any', | ||
| 17 | required => 1, | ||
| 18 | ); | ||
| 19 | |||
| 20 | 2 | ▶ | sub _build_message { |
|
Subroutine
_build_message: called CC=1 SCAR=0.0
| |||
| 21 | 2 | my $self = shift; | |
| 22 | 2 | "Cannot delegate ".$self->method->name." to " | |
| 23 | .$self->method->delegate_to_method." because the value of " | ||
| 24 | . $self->attribute->name . " is not an object (got '".$self->given_value."')"; | ||
| 25 | } | ||
| 26 | |||
| 27 | 2 | __PACKAGE__->meta->make_immutable; | |
| 28 | 2 | 1; | |