File Coverage

blib/lib/Search/OpenSearch/Feed.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Search::OpenSearch::Feed;
2 1     1   13294 use Moo;
  1         22018  
  1         7  
3 1     1   1653 use Types::Standard qw( HashRef ArrayRef Int Str Num Maybe );
  1         49312  
  1         14  
4 1     1   943 use Carp;
  1         1  
  1         190  
5              
6             our $VERSION = '0.101';
7              
8             has 'entries' => ( is => 'rw', isa => ArrayRef );
9             has 'total' => ( is => 'rw', isa => Int );
10             has 'facets' => ( is => 'rw', isa => Maybe[HashRef] );
11             has 'page_size' => ( is => 'rw', isa => Int );
12             has 'offset' => ( is => 'rw', isa => Int, default => sub {0} );
13             has 'query' => ( is => 'rw', isa => Maybe[Str] );
14             has 'id' => ( is => 'rw', isa => Str );
15             has 'title' => ( is => 'rw', isa => Str );
16             has 'build_time' => ( is => 'rw', isa => Maybe[Num] );
17             has 'search_time' => ( is => 'rw', isa => Maybe[Num] );
18             has 'suggestions' => ( is => 'rw', isa => Maybe[HashRef] );
19             has 'updated' => ( is => 'rw', isa => Str );
20              
21             =head1 NAME
22              
23             Search::OpenSearch::Feed - client-side representation of a Search::OpenSearch::Response::XML
24              
25             =head1 SYNOPSIS
26              
27             my $feed = Search::OpenSearch::FeedParser->new->parse( $sos_response_xml );
28             printf("total: %s\n", $feed->total);
29             for my $entry (@{ $feed->entries }) {
30             printf(" uri: %s\n", $entry->{uri});
31             }
32              
33             =head1 DESCRIPTION
34              
35             Search::OpenSearch::Feed represents the parsed response from Search::OpenSearch::Response::XML.
36             See L.
37              
38             =head1 METHODS
39              
40             The following attributes are available:
41              
42             =head2 entries
43              
44             =head2 total
45              
46             =head2 facets
47              
48             =head2 page_size
49              
50             =head2 offset
51              
52             =head2 query
53              
54             =head2 id
55              
56             =head2 title
57              
58             =head2 build_time
59              
60             =head2 search_time
61              
62             =head2 suggestions
63              
64             =head2 updated
65              
66             =cut
67              
68             1;
69              
70             __END__