File Coverage

blib/lib/Net/OpenSocial/Client/Agent/Dump.pm
Criterion Covered Total %
statement 9 14 64.2
branch n/a
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 19 68.4


line stmt bran cond sub pod time code
1             package Net::OpenSocial::Client::Agent::Dump;
2              
3 1     1   6 use Any::Moose;
  1         2  
  1         9  
4              
5             has '_agent' => (
6             is => 'ro',
7             default => sub { LWP::UserAgent->new },
8             );
9              
10 1     1   1668 use Data::Dump qw(dump);
  1         7117  
  1         163  
11              
12             sub request {
13 0     0 1   my ($self, $request) = @_;
14 0           warn dump($request);
15 0           my $response = $self->_agent->request($request);
16 0           warn dump($response);
17 0           return $response
18             }
19              
20              
21 1     1   11 no Any::Moose;
  1         2  
  1         11  
22             __PACKAGE__->meta->make_immutable;
23             1;
24              
25             =head1 NAME
26              
27             Net::OpenSocial::Client::Agent::Dump - Agent for debug
28              
29             =head1 SYNOPSIS
30              
31             my $client = Net::OpenSocial::Client->new(
32             agent => Net::OpenSocial::Client::Agent::Dump->new,
33             ...
34             );
35              
36             =head1 DESCRIPTION
37              
38             For debug, this agent dump HTTP::Request and HTTP::Response object
39             around requesting.
40             Decorator of LWP::UserAgent.
41              
42             =head1 METHODS
43              
44             =head2 request
45              
46             Interface same as LWP::UserAgent
47              
48             =head1 AUTHOR
49              
50             Lyo Kato, Elyo.kato@gmail.comE
51              
52             =head1 COPYRIGHT AND LICENSE
53              
54             Copyright (C) 2009 by Lyo Kato
55              
56             This library is free software; you can redistribute it and/or modify
57             it under the same terms as Perl itself, either Perl version 5.8.8 or,
58             at your option, any later version of Perl 5 you may have available.
59              
60             =cut
61