line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OAuth::Lite2::Formatter; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
4087
|
use strict; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
230
|
|
4
|
8
|
|
|
8
|
|
40
|
use warnings; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
1299
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
0
|
|
|
0
|
0
|
|
sub new { bless {}, $_[0] } |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
0
|
1
|
|
sub name { die "abstract method" } |
10
|
0
|
|
|
0
|
1
|
|
sub type { die "abstract method" } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub format { |
13
|
0
|
|
|
0
|
1
|
|
my ($self, $hash) = @_; |
14
|
0
|
|
|
|
|
|
die "abstract method"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub parse { |
18
|
0
|
|
|
0
|
1
|
|
my ($self, $content) = @_; |
19
|
0
|
|
|
|
|
|
die "abstract method"; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 NAME |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
OAuth::Lite2::Formatter - OAuth 2.0 formatter base class |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SYNOPSIS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
package OAuth::Lite2::Formatter::Foo; |
29
|
|
|
|
|
|
|
use parent 'OAuth::Lite2::Formatter'; |
30
|
|
|
|
|
|
|
... |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $formatter = OAuth::Lite2::Formatter::Foo->new; |
33
|
|
|
|
|
|
|
my $obj = $formatter->parse( $string ); |
34
|
|
|
|
|
|
|
$string = $formatter->format( $obj ); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
OAuth 2.0 formatter base class |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 name |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Accessor for name of this format. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 type |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Accessor for content-type of this format. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 format( $object ) |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $formatted_string = $formatter->format( $obj ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 parse( $formatted_string ) |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $obj = $formatter->parse( $formatted_string ); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SEE ALSO |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
L |
61
|
|
|
|
|
|
|
L |
62
|
|
|
|
|
|
|
L |
63
|
|
|
|
|
|
|
L |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AUTHOR |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Lyo Kato, Elyo.kato@gmail.comE |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Copyright (C) 2010 by Lyo Kato |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
74
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
75
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |