| 1 | package OAuth::Lite2::Formatter; | ||
| 2 | |||
| 3 | 8 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 8 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | |||
| 7 | 32 | ▶ | sub new { bless {}, $_[0] } |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 8 | |||
| 9 | 0 | ▶ | sub name { die "abstract method" } |
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 10 | 0 | ▶ | sub type { die "abstract method" } |
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 11 | |||
| 12 | 0 | ▶ | sub format { |
|
Subroutine
format: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 13 | 0 | my ($self, $hash) = @_; | |
| 14 | 0 | die "abstract method"; | |
| 15 | } | ||
| 16 | |||
| 17 | 0 | ▶ | sub parse { |
|
Subroutine
parse: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 18 | 0 | 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<OAuth::Lite2::Formatters> | ||
| 61 | L<OAuth::Lite2::Formatter::JSON> | ||
| 62 | L<OAuth::Lite2::Formatter::XML> | ||
| 63 | L<OAuth::Lite2::Formatter::FormURLEncoded> | ||
| 64 | |||
| 65 | =head1 AUTHOR | ||
| 66 | |||
| 67 | Lyo Kato, E<lt>lyo.kato@gmail.comE<gt> | ||
| 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 | 8 | 1; | |