ActionPack/Core/BaseAuthHeader.pm

filter: Statementstmt 100% 33 / 33 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 4 / 4 totaltotal 97.9% 48 / 49 CC 2 SCAR 1.7
CC
2
Cov
97%
BUILDARGS
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« ActionPack/Core/BaseHeaderType.pm ↑ Summary ActionPack/LinkList.pm »
1 package HTTP::Headers::ActionPack::Core::BaseAuthHeader;
2 5 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 $HTTP::Headers::ActionPack::Core::BaseAuthHeader::AUTHORITY = 'cpan:STEVAN';
4 }
5 {
6 5 $HTTP::Headers::ActionPack::Core::BaseAuthHeader::VERSION = '0.09';
7 }
8 # ABSTRACT: The base Auth Header
9  
10 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 5 ▶use Carp qw[ confess ];
Subroutine BEGIN: called CC=1 SCAR=0.0
14 5 ▶use HTTP::Headers::ActionPack::Util qw[
Subroutine BEGIN: called CC=1 SCAR=0.0
15 join_header_params
16 5 ];
17  
18 5 ▶use parent 'HTTP::Headers::ActionPack::Core::BaseHeaderWithParams';
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 10 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=2 SCAR=7.0
Pod documented
21 10 my $class = shift;
22 10 my ($type, @params) = @_;
23  
24 10 ▶ confess "You must specify an auth-type" unless $type;
Branch: 1 branch
BranchTrueFalseTotal
unless $type 0 10 10
25  
26 return +{
27 auth_type => $type,
28 10 %{ $class->_prepare_params( @params ) }
29 };
30 }
31  
32 5 ▶sub new_from_string {
Subroutine new_from_string: called CC=1 SCAR=0.0
Pod documented
33 5 my ($class, $header_string) = @_;
34  
35 5 my @parts = HTTP::Headers::Util::_split_header_words( $header_string );
36 5 splice @{ $parts[0] }, 1, 1;
37  
38 5 $class->new( map { @$_ } @parts );
39 }
40  
41 20 ▶sub auth_type { (shift)->{'auth_type'} }
Subroutine auth_type: called CC=1 SCAR=0.0
Pod documented
42  
43 10 ▶sub as_string {
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
44 10 my $self = shift;
45 10 $self->auth_type . ' ' . join_header_params( ', ' => $self->params_in_order );
46 }
47  
48 5 1;
49  
50 __END__
« ActionPack/Core/BaseHeaderType.pm ↑ Summary ActionPack/LinkList.pm »