use Carp::Clan qw/^DBIx::Class/;
-=head1 NAME
+=head1 NAME
DBIx::Class::AccessorGroup - Lets you build groups of accessors
return $self->{$get};
} else {
$get = "_$get";
- return $self->can($get) ? $self->$get : undef;
+ return $self->can($get) ? $self->$get : undef;
}
}
sub set_component_class {
my ($self, $set, $val) = @_;
eval "require $val";
+ if ($@) {
+ my $val_path = $val;
+ $val_path =~ s{::}{/}g;
+ carp $@ unless $@ =~ /^Can't locate $val_path\.pm/;
+ }
if (ref $self) {
return $self->{$set} = $val;
} else {
$set = "_$set";
return $self->can($set) ?
- $self->$set($val) :
- $self->mk_classdata($set => $val);
- }
+ $self->$set($val) :
+ $self->mk_classdata($set => $val);
+ }
}
1;