| 1 | package OpenID::Lite::Agent::Dump; | ||
| 2 | |||
| 3 | 1 | ▶ | use Any::Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use LWP::UserAgent; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Data::Dump qw(dump); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | has '_agent' => ( | ||
| 8 | is => 'ro', | ||
| 9 | 0 | ▶ | default => sub { LWP::UserAgent->new, }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 10 | 1 | ); | |
| 11 | |||
| 12 | 0 | ▶ | sub get { |
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 13 | 0 | my ( $self, $url ) = @_; | |
| 14 | 0 | dump($url); | |
| 15 | 0 | my $response = $self->_agent->get($url); | |
| 16 | 0 | dump($response); | |
| 17 | 0 | return $response; | |
| 18 | } | ||
| 19 | |||
| 20 | 0 | ▶ | sub request { |
|
Subroutine
request: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 21 | 0 | my ( $self, $request ) = @_; | |
| 22 | 0 | dump($request); | |
| 23 | 0 | my $response = $self->_agent->request($request); | |
| 24 | 0 | dump($response); | |
| 25 | 0 | return $response; | |
| 26 | } | ||
| 27 | |||
| 28 | 1 | ▶ | no Any::Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | 1 | __PACKAGE__->meta->make_immutable; | |
| 30 | 1 | 1; | |
| 31 | |||
| 32 | =head1 NAME | ||
| 33 | |||
| 34 | OpenID::Lite::Agent::Dump - agent for debug | ||
| 35 | |||
| 36 | =head1 SYNOPSIS | ||
| 37 | |||
| 38 | my $rp = OpenID::Lite::RelyingParty->new( agent => OpenID::Lite::Agent::Dump->new ); | ||
| 39 | |||
| 40 | =head1 DESCRIPTION | ||
| 41 | |||
| 42 | This is just a decorator of LWP::UserAgent. | ||
| 43 | Dump the request and response object for each request. | ||
| 44 | |||
| 45 | =head1 AUTHOR | ||
| 46 | |||
| 47 | Lyo Kato, E<lt>lyo.kato@gmail.comE<gt> | ||
| 48 | |||
| 49 | =head1 COPYRIGHT AND LICENSE | ||
| 50 | |||
| 51 | Copyright (C) 2009 by Lyo Kato | ||
| 52 | |||
| 53 | This library is free software; you can redistribute it and/or modify | ||
| 54 | it under the same terms as Perl itself, either Perl version 5.8.8 or, | ||
| 55 | at your option, any later version of Perl 5 you may have available. | ||
| 56 | |||
| 57 | =cut | ||