|
sub new {
my ( $class , %args ) = @_ ;
foreach my $method ( qw(call load) ) {
*{ "$class\::$method" } = sub {
+ shift ->_top-> $method ( @_ );
} unless defined &{ "$class\::$method" };
}
bless (\ %args , $class );
}
sub AUTOLOAD {
my $self = shift ;
goto &{ $self ->_top->autoload};
}
sub _top { $_ [0]->{_top} }
sub admin {
my $self = shift ;
$self ->_top->{admin} or Module::Install::Base::FakeAdmin->new;
}
sub is_admin {
my $self = shift ;
$self ->admin->VERSION;
}
sub DESTROY {}
my $Fake ;
sub new { $Fake ||= bless (\ @_ , $_ [0]) }
sub AUTOLOAD {}
sub DESTROY {}
1;
|