Client/Agent/Dump.pm

filter: Statementstmt 66.6% 12 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 1 / 1 totaltotal 66.6% 16 / 24 CC 1 SCAR 3.4
CC
1
Cov
67%
__ANON__
2.0
request
2.0
BEGIN
1.0
CRAP 1.4
« Client/ErrorHandler.pm ↑ Summary Client/Formatter/JSON.pm »
1 package Net::OpenSocial::Client::Agent::Dump;
2  
3 1 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 has '_agent' => (
6 is => 'ro',
7 0 ▶ default => sub { LWP::UserAgent->new },
Subroutine __ANON__: not called CC=1 SCAR=6.9
8 1 );
9  
10 1 ▶use Data::Dump qw(dump);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶sub request {
Subroutine request: not called CC=1 SCAR=6.9
Pod documented
13 0 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 ▶no Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 __PACKAGE__->meta->make_immutable;
23 1 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, E<lt>lyo.kato@gmail.comE<gt>
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  
« Client/ErrorHandler.pm ↑ Summary Client/Formatter/JSON.pm »