GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Metabase::Report(3) User Contributed Perl Documentation Metabase::Report(3)
 

Metabase::Report - a base class for collections of Metabase facts

version 0.025

  package MyReport;
  use Metabase::Report;
  our @ISA = qw/Metabase::Report/;
  __PACKAGE__->load_fact_classes;
  sub report_spec {
    return {
      'Fact::One' => 1,     # one of Fact::One
      'Fact::Two' => "0+",  # zero or more of Fact::Two
    }
  }

Metabase is a system for associating metadata with CPAN distributions. The metabase can be used to store test reports, reviews, coverage analysis reports, reports on static analysis of coding style, or anything else for which datatypes are constructed.
Metabase::Report is a base class for collections of Metabase::Fact objects that can be sent to or retrieved from a Metabase system.
Metabase::Report is itself a subclass of Metabase::Fact and offers the same API, except as described below.

A subclass of Metabase::Report only requires one method, "report_spec".

content
The "content" attribute of a Report must be a reference to an array of Metabase::Fact subclass objects.

In addition to the standard "new" constructor, the following "open", "add" and "close" methods may be used to construct a report piecemeal, instead.

  $report = Report::Subclass->open(
    id => 'AUTHORID/Foo-Bar-1.23.tar.gz',
  );
Constructs a new, empty report. The 'id' attribute is required. The 'refers_to' attribute is optional. The 'content' attribute may be provided, but see "add" below. No other attributes may be provided to "new".

  $report->add( 'Fact::Subclass' => $content );
Using the 'id' attribute of the report, this method constructs a new Fact from a class and a content argument. The resulting Fact is appended to the Report's content array.

  $report->close;
This method validates the report based on all Facts added so far.

This method returns a list of all the facts in the report. In scalar context, it returns the number of facts in the report.

Loads each class listed in the report spec.

Methods marked as 'required' must be implemented by a report subclass. (The version in Metabase::Report will die with an error if called.)
In the documentation below, the terms 'must, 'must not', 'should', etc. have their usual RFC 2119 meanings.
Methods MUST throw an exception if an error occurs.

required
  $spec = Report::Subclass->report_spec;
The "report_spec" method MUST return a hash reference that defines how many Facts of which types must be in the report for it to be considered valid. Keys MUST be class names. Values MUST be non-negative integers that indicate the number of Facts of that type that must be present for a report to be valid, optionally followed by a '+' character to indicate that the report may contain more than the given number.
For example:
  {
    Fact::One => 1,     # one of Fact::One
    Fact::Two => "0+",  # zero or more of Fact::Two
  }

Please report any bugs or feature using the CPAN Request Tracker. Bugs can be submitted through the web interface at <http://rt.cpan.org/Dist/Display.html?Queue=Metabase-Fact>
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

David Golden <dagolden@cpan.org>
Ricardo Signes <rjbs@cpan.org>
H.Merijn Brand <hmbrand@cpan.org>

This software is Copyright (c) 2016 by David Golden.
This is free software, licensed under:
  The Apache License, Version 2.0, January 2004
2016-02-29 perl v5.28.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.