XMPP/Error/IQAuth.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 21 CC 2 SCAR 12.0
CC
2
Cov
0%
string
6.0
context
2.0
iq_error
2.0
CRAP 3.3
1 package AnyEvent::XMPP::Error::IQAuth;
2 use AnyEvent::XMPP::Error;
3 use strict;
4 our @ISA = qw/AnyEvent::XMPP::Error/;
5  
6 =head1 NAME
7  
8 AnyEvent::XMPP::Error::IQAuth - IQ authentication error
9  
10 Subclass of L<AnyEvent::XMPP::Error>
11  
12 =head2 METHODS
13  
14 =over 4
15  
16 =item B<context>
17  
18 This method returns either:
19  
20 C<iq_error> which means that a IQ error was caught, which
21 can be accessed with the C<iq_error> method.
22  
23 Or: C<no_fields> which means that no form fields were found
24 in the IQ auth result.
25  
26 =cut
27  
28 sub context { $_[0]->{context} }
29  
30 sub iq_error { $_[0]->{iq_error} }
31  
32 sub string {
33 my ($self) = @_;
34  
35 sprintf "iq auth error: '%s' %s",
36 $self->context, ($self->context eq 'iq_error' ? $self->iq_error ()->string : '')
37 }
38  
39 =back
40  
41 =head1 AUTHOR
42  
43 Robin Redeker, C<< <elmex at ta-sa.org> >>, JID: C<< <elmex at jabber.org> >>
44  
45 =head1 COPYRIGHT & LICENSE
46  
47 Copyright 2007, 2008 Robin Redeker, all rights reserved.
48  
49 This program is free software; you can redistribute it and/or modify it
50 under the same terms as Perl itself.
51  
52 =cut
53  
54 1;