line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id$ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2007 Daisuke Maki <daisuke@endeworks.jp> |
4
|
|
|
|
|
|
|
# All rights reserved. |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Gungho::Response; |
7
|
1
|
|
|
1
|
|
593
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
8
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
9
|
1
|
|
|
1
|
|
3
|
use base qw(HTTP::Response); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
10
|
1
|
|
|
1
|
|
2014
|
use Storable qw(dclone); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
181
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
13
|
|
|
|
|
|
|
{ |
14
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
16
|
0
|
|
|
|
|
|
$self->{_notes} = {}; |
17
|
0
|
|
|
|
|
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub clone |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
23
|
0
|
|
|
|
|
|
my $clone = $self->SUPER::clone; |
24
|
0
|
|
|
|
|
|
my $cloned_notes = dclone $self->notes; |
25
|
0
|
|
|
|
|
|
foreach my $note (keys %$cloned_notes) { |
26
|
0
|
|
|
|
|
|
$clone->notes( $note => $cloned_notes->{$note} ); |
27
|
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
return $clone; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub notes |
32
|
|
|
|
|
|
|
{ |
33
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
my $key = shift; |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
return $self->{_notes} unless $key; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $value = $self->{_notes}{$key}; |
39
|
0
|
0
|
|
|
|
|
if (@_) { |
40
|
0
|
|
|
|
|
|
$self->{_notes}{$key} = $_[0]; |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
|
return $value; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Gungho::Response - Gungho HTTP Response Object |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This module is exactly the same as HTTP::Response, but adds notes() |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 METHODS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 new |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 clone |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 notes |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |