File Coverage

blib/lib/Protocol/XMPP/Element/Mechanisms.pm
Criterion Covered Total %
statement 9 20 45.0
branch 0 2 0.0
condition n/a
subroutine 3 5 60.0
pod 1 2 50.0
total 13 29 44.8


line stmt bran cond sub pod time code
1             package Protocol::XMPP::Element::Mechanisms;
2              
3 1     1   285583 use strict;
  1         3  
  1         49  
4 1     1   6 use warnings;
  1         2  
  1         80  
5 1     1   42 use parent qw(Protocol::XMPP::ElementBase);
  1         3  
  1         10  
6              
7             our $VERSION = '0.007'; ## VERSION
8              
9             =head1 NAME
10              
11             =head1 SYNOPSIS
12              
13             =head1 DESCRIPTION
14              
15             =head1 METHODS
16              
17             =cut
18              
19             sub add_mechanism {
20 0     0 0   my $self = shift;
21 0           my $mech = shift;
22 0           push @{ $self->{mechanism} }, $mech;
  0            
23 0           $self;
24             }
25              
26             sub end_element {
27 0     0 1   my $self = shift;
28 0           $self->debug("Supported auth mechanisms: " . join(' ', map { $_->type } @{$self->{mechanism}}));
  0            
  0            
29 0 0         $self->parent->{mechanism} = $self->{mechanism} if $self->parent;
30 0           $self;
31             }
32              
33             1;
34              
35             __END__