File Coverage

blib/lib/OAuth/Lite2/Formatter/Text.pm
Criterion Covered Total %
statement 12 18 66.6
branch n/a
condition n/a
subroutine 4 8 50.0
pod 4 4 100.0
total 20 30 66.6


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