use Sub::Name 'subname';
use overload ();
-our $VERSION = '0.19';
+our $VERSION = '0.18';
our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::Method::Accessor;
my $val;
my $value_is_set;
- if (exists $params->{$init_arg}) {
+ if ( defined($init_arg) and exists $params->{$init_arg}) {
$val = $params->{$init_arg};
$value_is_set = 1;
}
$associated_class->add_method($handle => subname $name, sub {
my $proxy = (shift)->$accessor();
@_ = ($proxy, @_);
-
- defined($proxy)
- or confess "Undefined 'handles' for attribute '".$self->name."' for method '$name'.";
-
+ (defined $proxy)
+ || confess "Cannot delegate $handle to $method_to_call because " .
+ "the value of " . $self->name . " is not defined";
goto &{ $proxy->can($method_to_call) || return };
});
}