OAuth/Headers.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 17 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
add
2.0
headers
2.0
CRAP 2.0
1 package Google::OAuth::Headers ;
2 @Google::OAuth::Headers::ISA = qw( Google::OAuth::Request ) ;
3  
4 ## use this package for custom header fields:
5 ## Google::OAuth::Headers->new( $token )->add(
6 ## foo => 'bar'
7 ## )->request( GET => $url, ... ) ;
8  
9 sub new {
10 my $package = shift ;
11 return bless { headers => [], token => shift @_ }, $package ;
12 }
13  
14 sub add {
15 my $self = shift ;
16 push @{ $self->{headers} }, @_ ;
17 return $self ;
18 }
19  
20 sub headers {
21 my $self = shift ;
22 my $method = shift ;
23  
24 return $self->{token}->headers( $method ), @{ $self->{headers} } ;
25 }
26  
27 1