<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Debian::WNPP::Bug;

use strict;
use warnings;

our $VERSION = '0.64';

=head1 NAME

Debian::WNPP::Bug - handy representation of Debian WNPP bug reports

=head1 SYNOPSIS

    my $b = Debian::WNPP::Bug-&gt;new(
        {   number            =&gt; 1234,
            title             =&gt; 'RFP: nice-package -- do nice things easier',
            type              =&gt; 'rfp',
            package           =&gt; 'nice-package',
            short_description =&gt; 'do nice things together',
            submitter         =&gt; "Joe Developer &lt;joe@developer.local&gt;"
        }
    );

    print "$b";     # 1234

=cut

use base qw(Class::Accessor);
__PACKAGE__-&gt;mk_accessors(
    qw(
        number title type package short_description submitter
        )
);

=head1 CONSTRUCTOR

=over

=item new

Constructs new instance of the class. Initial values are to be given as a hash
reference.

=back

=head1 FIELDS

=over

=item number

The unique ID of the big in the BTS.

=item title

The title of the bug. Usually something like

    RFP: nice-package -- do nice things easier

=item type

The type of the WNPP bug. Either of:

=over

=item RFP

request for package

=item ITP

intent to package

=item O

orphaned package

=item RFH

request for help

=item RFA

request for adoption

=item ITA

intent to adopt

=back

=item package

Package name

=item short_description

The short description of the package

=item submitter

The bug submitter in the form C&lt;&lt; Full Name &lt;email@address&gt; &gt;&gt;

=back

=head1 OVERLOADS

=over

=item ""

C&lt;Debian::WNPPBug&gt; object instances stringify via the method L&lt;|as_string&gt;. The
default C&lt;as_string&gt; method returns the bug number.

=cut

use overload '""' =&gt; \&amp;as_string;

=back

=head1 METHODS

=over

=item type_and_number

Returns a string representing the bug type and number in the form I&lt;TYPE&gt;
#I&lt;number&gt;, e.g. C&lt;ITP #1234&gt;.

=cut

sub type_and_number {
    my $self = shift;
    return $self-&gt;type . ' #' . $self-&gt;number;
}

=item as_string

Used for the "" overload. Returns the bug number.

=cut

sub as_string {
    my $self = shift;
    return $self-&gt;number;
}

=back

=head1 AUTHOR

=over 4

=item Damyan Ivanov &lt;dmn@debian.org&gt;

=back

=head1 COPYRIGHT &amp; LICENSE

=over 4

=item Copyright (C) 2010 Damyan Ivanov &lt;dmn@debian.org&gt;

=back

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the Free
Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301 USA.

=cut

1;
</pre></body></html>