CPAN::Testers::WWW::Reports::Report - CPAN::Testers::WWW::Reports::Report documentation


CPAN-Testers-WWW-Reports-Parser documentation Contained in the CPAN-Testers-WWW-Reports-Parser distribution.

Index


Code Index:

NAME

Top

CPAN::Testers::WWW::Reports::Report

SYNOPSIS

Top

  use CPAN::Testers::WWW::Reports::Parser;

  my $obj = CPAN::Testers::WWW::Reports::Parser->new(
        format  => 'YAML',  # or 'JSON'
        file    => $file    # or data => $data
        objects => 1,       # Optional, works with $obj->report()
  );

  # iterator, accessing aternate field names
  while( my $report = $obj->report() ) {
      $report->action();
      $report->archname();
      $report->csspatch(); 
      $report->cssperl();
      $report->dist();
      $report->distribution(); 
      $report->distversion(); 
      $report->grade();
      $report->guid();
      $report->id();
      $report->osname();
      $report->ostext();       
      $report->osvers();
      $report->perl();        
      $report->platform();
      $report->state();    
      $report->status();     
      $report->url();      
      $report->version();      
  }

DESCRIPTION

Top

This distribution is used to extract the data from either a JSON or a YAML file containing metadata regarding reports submitted by CPAN Testers, and available from the CPAN Testers website.

INTERFACE

Top

The Constructor

* new

Instatiates the object CPAN::Testers::WWW::Reports::Report:

  my $report = CPAN::Testers::WWW::Reports::Report->new(\%report);

Report Methods

All the following methods are available as per the hash API listed in CPAN::Testers::WWW::Reports::Parser.

* action
* archname
* csspatch
* cssperl
* dist
* distribution
* distversion
* grade
* guid
* id
* osname
* ostext
* osvers
* perl
* platform
* state
* status
* url
* version

BUGS, PATCHES & FIXES

Top

There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties, that is not explained within the POD documentation, please send bug reports and patches to the RT Queue (see below).

Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me.

RT: http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Testers-WWW-Reports-Parser

SEE ALSO

Top

http://www.cpantesters.org/, http://stats.cpantesters.org/, http://wiki.cpantesters.org/, http://blog.cpantesters.org/

AUTHOR

Top

  Barbie <barbie@cpan.org> 2009-present

  Original code for this module submitted by 
  Leo Lapworth (Ranguard) <llap@cpan.org>

COPYRIGHT AND LICENSE

Top


CPAN-Testers-WWW-Reports-Parser documentation Contained in the CPAN-Testers-WWW-Reports-Parser distribution.

package CPAN::Testers::WWW::Reports::Report;

use 5.006;
use strict;
use warnings;

use vars qw($VERSION);
$VERSION = '0.03';

#----------------------------------------------------------------------------
# Library Modules

use Carp;
our $AUTOLOAD;

#----------------------------------------------------------------------------
# Variables

my @methods = (
    "ostext",       "osvers",   "perl",        "platform",
    "version",      "csspatch", "distversion", "id",
    "status",       "state",    "cssperl",     "dist",
    "distribution", "osname",   "guid",        "grade",
    "archname",     "action",   "url"
);
my %permitted_methods = map { $_ => 1 } @methods;

#----------------------------------------------------------------------------
# The Application Programming Interface

sub new {
    my ( $class, $self ) = @_;

    bless $self, 'CPAN::Testers::WWW::Reports::Report';

    $self->{_permitted} = \%permitted_methods;

    return $self;
}

sub DESTROY {}

sub AUTOLOAD {
    my $self = shift;
    my $type = ref($self)
        or croak "$self is not an object";

    my $name = $AUTOLOAD;
    $name =~ s/.*://;    # strip fully-qualified portion

    unless ( exists $self->{_permitted}->{$name} ) {
        croak "Can't access `$name' field in class $type";
    }

    if (@_) {
        return $self->{$name} = shift;
    } else {
        return $self->{$name};
    }
}

1;

__END__