CPANTS-Kwalitee-Report

 view release on metacpan or  search on metacpan

lib/CPANTS/Kwalitee/Report/Distribution.pm  view on Meta::CPAN

package CPANTS::Kwalitee::Report::Distribution;

$CPANTS::Kwalitee::Report::Distribution::VERSION   = '0.11';
$CPANTS::Kwalitee::Report::Distribution::AUTHORITY = 'cpan:MANWAR';

=head1 NAME

CPANTS::Kwalitee::Report::Distribution - CPANTS Kwalitee Report Distribution.

=head1 VERSION

Version 0.11

=cut

use 5.006;
use Data::Dumper;

use Moo;
use namespace::autoclean;

use overload q{""} => 'as_string', fallback => 1;

has [qw(name path)]   => (is => 'ro', required => 1);
has [qw(link scores)] => (is => 'rw');

=head1 DESCRIPTION

It represents the search result of distribution kwalitee scores.

=head1 SYNOPSIS

    use strict; use warnings;
    use CPANTS::Kwalitee::Report;

    my $report = CPANTS::Kwalitee::Report->new;

    my $dist = $report->scores('Map::Tube');
    print sprintf("Path  : %s\n"  , $dist->path);
    print sprintf("Scores: \n%s\n", join("\n", @{$dist->scores}));
`
=head1 METHODS

=head2 name()

Returns distribution name.

=head2 path()

Returns distribution path.

=head2 link()

Returns distribution link.

=head2 scores()

Returns an array ref of objects of type L<CPANTS::Kwalitee::Report::Score>.

=cut

sub as_string {
    my ($self) = @_;

    my $distribution = sprintf("%s (%s)\n", $self->name, $self->path);
    $distribution .= join("\n", @{$self->scores});

    return $distribution;
}

=head1 AUTHOR

Mohammad S Anwar, C<< <mohammad.anwar at yahoo.com> >>

=head1 REPOSITORY

L<https://github.com/manwar/CPANTS-Kwalitee-Report>

=head1 BUGS



( run in 1.104 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )