File Coverage

blib/lib/WebService/Blekko/QueryResult.pm
Criterion Covered Total %
statement 15 23 65.2
branch n/a
condition n/a
subroutine 5 9 55.5
pod 4 6 66.6
total 24 38 63.1


line stmt bran cond sub pod time code
1             #
2              
3             package WebService::Blekko::QueryResult;
4              
5 3     3   17 use strict;
  3         4  
  3         114  
6 3     3   17 use warnings;
  3         6  
  3         83  
7 3     3   15 no warnings qw( uninitialized );
  3         5  
  3         1014  
8              
9             =head1 NAME
10              
11             WebService::Blekko::QueryResult -- a single result from WebService::Blekko::query
12              
13             =cut
14              
15             our $VERSION = '1.00';
16              
17             sub new
18             {
19 20     20 0 30 my $class = shift;
20 20         100 my $self = bless {}, $class;
21              
22 20         65 $self->{result} = $_[0];
23              
24 20         54 return $self;
25             }
26              
27             # accessors
28              
29             =head1 METHODS
30              
31             =head2 title
32              
33             The title of this result, including HTML markup highlighting the
34             search terms.
35              
36             =head2 snippet
37              
38             A snippet from the result, including HTML markup.
39              
40             =head2 url
41              
42             The URL of the result.
43              
44             =head2 display_url
45              
46             The URL of the result, including HTML markup.
47              
48             =cut
49              
50             sub title
51             {
52 0     0 1 0 my ( $self ) = @_;
53              
54 0         0 return $self->{result}->{url_title};
55             }
56              
57             sub snippet
58             {
59 0     0 1 0 my ( $self ) = @_;
60              
61 0         0 return $self->{result}->{snippet};
62             }
63              
64             sub url
65             {
66 0     0 1 0 my ( $self ) = @_;
67              
68 0         0 return $self->{result}->{url};
69             }
70              
71             sub display_url
72             {
73 0     0 1 0 my ( $self ) = @_;
74              
75 0         0 return $self->{result}->{display_url};
76             }
77              
78             sub raw
79             {
80 120     120 0 532 my ( $self ) = @_;
81              
82 120         293 return $self->{result};
83             }
84              
85             1;