<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package CPANPLUS::Module::Author::Fake;
use deprecate;


use CPANPLUS::Module::Author;
use CPANPLUS::Internals;
use CPANPLUS::Error;

use strict;
use vars            qw[@ISA $VERSION];
use Params::Check   qw[check];

$VERSION = "0.9135";

@ISA = qw[CPANPLUS::Module::Author];

$Params::Check::VERBOSE = 1;

=pod

=head1 NAME

CPANPLUS::Module::Author::Fake - dummy author object for CPANPLUS

=head1 SYNOPSIS

    my $auth = CPANPLUS::Module::Author::Fake-&gt;new(
                    author  =&gt; 'Foo Bar',
                    email   =&gt; 'luser@foo.com',
                    cpanid  =&gt; 'FOO',
                    _id     =&gt; $cpan-&gt;id,
                );

=head1 DESCRIPTION

A class for creating fake author objects, for shortcut use internally
by CPANPLUS.

Inherits from C&lt;CPANPLUS::Module::Author&gt;.

=head1 METHODS

=head2 new( _id =&gt; DIGIT )

Creates a dummy author object. It can take the same options as
C&lt;&lt; CPANPLUS::Module::Author-&gt;new &gt;&gt;, but will fill in default ones
if none are provided. Only the _id key is required.

=cut

sub new {
    my $class = shift;
    my %hash  = @_;

    my $tmpl = {
        author  =&gt; { default =&gt; 'CPANPLUS Internals' },
        email   =&gt; { default =&gt; 'cpanplus-info@lists.sf.net' },
        cpanid  =&gt; { default =&gt; 'CPANPLUS' },
        _id     =&gt; { default =&gt; CPANPLUS::Internals-&gt;_last_id },
    };

    my $args = check( $tmpl, \%hash ) or return;

    my $obj = CPANPLUS::Module::Author-&gt;new( %$args ) or return;

    unless( $obj-&gt;_id ) {
        error(loc("No '%1' specified -- No CPANPLUS object associated!",'_id'));
        return;
    }

    ### rebless object ###
    return bless $obj, $class;
}

1;


# Local variables:
# c-indentation-style: bsd
# c-basic-offset: 4
# indent-tabs-mode: nil
# End:
# vim: expandtab shiftwidth=4:
</pre></body></html>