File Coverage

blib/lib/Net/OAI/Record.pm
Criterion Covered Total %
statement 13 13 100.0
branch 4 4 100.0
condition 5 7 71.4
subroutine 5 5 100.0
pod 4 4 100.0
total 31 33 93.9


line stmt bran cond sub pod time code
1             package Net::OAI::Record;
2              
3 16     16   75 use strict;
  16         28  
  16         3233  
4              
5             =head1 NAME
6              
7             Net::OAI::Record - An OAI-PMH record.
8              
9             =head1 SYNOPSIS
10              
11             =head1 DESCRIPTION
12              
13             =head1 METHODS
14              
15             =head2 new()
16              
17             probably don't want to instantiate this yourself
18              
19             =cut
20              
21             sub new {
22 1408     1408 1 4953 my ( $class, %opts ) = @_;
23             return bless {
24             header => $opts{ header },
25 1408 100       5123 @{[$opts{ metadata } ? (metadata => $opts{ metadata }) : ()]},
26 1408 100 33     2656 @{[$opts{ recorddata } ? (recorddata => $opts{ recorddata }) : ()]},
  1408         13234  
27             }, ref( $class ) || $class;
28             }
29              
30             =head2 header()
31              
32             =cut
33              
34             sub header {
35 1211     1211 1 471606 my $self = shift;
36 1211         3322 return( $self->{ header } );
37             }
38              
39             =head2 metadata()
40              
41             =cut
42              
43             sub metadata {
44 1206     1206 1 225440 my $self = shift;
45             # return undef unless exists $self->{ metadata };
46 1206   100     6768 return $self->{ metadata } || undef;
47             }
48              
49             =head2 recorddata()
50              
51             =cut
52              
53             sub recorddata {
54 602     602 1 148531 my $self = shift;
55             # return undef unless exists $self->{ recorddata };
56 602   100     2969 return $self->{ recorddata } || undef;
57             }
58              
59             =head1 TODO
60              
61             =head1 SEE ALSO
62              
63             =head1 AUTHORS
64              
65             Ed Summers
66              
67             =cut
68              
69              
70             1;