-
-
17 Feb 2009 11:06:59 UTC
- Distribution: Biblio-COUNTER
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (581 / 0 / 0)
- Kwalitee
Bus factor: 1- 18.29% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (54KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Text::CSV
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Biblio::COUNTER::Processor - superclass for Biblio::COUNTER processors
SYNOPSIS
# Use use Biblio::COUNTER::Processor; $processor = Biblio::COUNTER::Processor->new; $processor->ignore(@events); $report = $processor->run; # Subclass use MyProcessor; @MyProcessor::ISA = qw(Biblio::COUNTER::Processor); # Event handlers sub begin_report { my ($self, $report) = @_; # etc. } sub count { my ($self, $report, $scope, $field, $period, $val) = @_; # etc. } # etc.
DESCRIPTION
Biblio::COUNTER::Processor is an inheritable class that provides an intermediate interface to Biblio::COUNTER. When used on its own, it does nothing; subclasses must define handlers for the various events (e.g.,
begin_report
orcount
) that are triggered as a report is processed.Event-handling methods (if defined) are invoked with the arguments documented in Biblio::COUNTER, except that an additional argument (the instance of the Biblio::COUNTER::Processor subclass) is prepended.
For a class that actually does something when events are triggered, see Biblio::COUNTER::Processor::Simple.
METHODS
- new
-
$processor = Biblio::COUNTER::Processor->new;
Create a new processor.
- run($file)
-
$report = $processor->run($what);
Process the given report.
$what may be a file handle, the name of a file, or an instance of (a subclass of) Biblio::COUNTER::Report.
A Biblio::COUNTER::Report object will be instantiated and its process method invoked; each time an event is triggered, a method with the event's name (e.g.,
begin_record
orcant_fix
) is invoked if it is defined. Since this class doesn't define any such methods, the default behavior when an event is triggered is to do nothing. - ignore(@events)
-
$processor->ignore(qw/line input output/);
Specify the events to ignore. The various events are documented in Biblio::COUNTER.
INHERITANCE
Biblio::COUNTER::Processor is designed to be inheritable; in fact, it doesn't do anything on its own (unless you count ignoring events as doing something).
BUGS
There are no known bugs. Please report bugs to the author via e-mail (see below).
AUTHOR
Paul Hoffman (nkuitse AT cpan DOT org)
COPYRIGHT
Copyright 2008 Paul M. Hoffman.
This is free software, and is made available under the same terms as Perl itself.
SEE ALSO
Module Install Instructions
To install Biblio::COUNTER, copy and paste the appropriate command in to your terminal.
cpanm Biblio::COUNTER
perl -MCPAN -e shell install Biblio::COUNTER
For more information on module installation, please visit the detailed CPAN module installation guide.