CPANTS-Kwalitee-Report

 view release on metacpan or  search on metacpan

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

package CPANTS::Kwalitee::Report::Score;

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

=head1 NAME

CPANTS::Kwalitee::Report::Score - Interface to Kwalitee Score.

=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(indicator value)] => (is => 'ro');

=head1 DESCRIPTION

It represents the kwalitee score details.

=head1 SYNOPSIS

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

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

    my $dist   = $report->scores('Map::Tube');
    my $scores = $dist->scores;

    print sprintf("Indicator: %s\n", $scores->[0]->indicator);
    print sprintf("Value    : %d\n", $scores->[0]->value);

=head1 METHODS

=head2 indicator()

Returns an object of type L<CPANTS::Kwalitee::Report::Indicator>.

=head2 value()

Returns the indicator value assigned to the corresponding distribution.

=cut

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

    return sprintf("%s: %d", $self->indicator->name, $self->value);
}

=head1 AUTHOR

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

=head1 REPOSITORY

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

=head1 BUGS

Please report any bugs or feature requests to C<bug-cpants-kwalitee-report at rt.cpan.org>,
or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPANTS-Kwalitee-Report>.
I will  be notified and then you'll automatically be notified of progress on your
bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc CPANTS::Kwalitee::Report::Score



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