File Coverage

blib/lib/AnyEvent/Ident/Transaction.pm
Criterion Covered Total %
statement 17 20 85.0
branch 1 2 50.0
condition n/a
subroutine 6 9 66.6
pod 6 6 100.0
total 30 37 81.0


line stmt bran cond sub pod time code
1             package AnyEvent::Ident::Transaction;
2              
3 4     4   45 use strict;
  4         9  
  4         158  
4 4     4   21 use warnings;
  4         7  
  4         113  
5 4     4   20 use AnyEvent::Ident::Response;
  4         7  
  4         1271  
6              
7             # ABSTRACT: Simple asynchronous ident transaction
8             our $VERSION = '0.06'; # VERSION
9              
10              
11 9     9 1 85 sub req { shift->{req} }
12              
13              
14             sub reply_with_user
15             {
16 4     4 1 26 my $self = shift;
17 4         9 my $username = pop;
18 4         6 my $os = shift;
19 4 50       18 $os = 'OTHER' unless defined $os;
20 4         41 $self->{cb}->(
21             AnyEvent::Ident::Response->new(
22             req => $self->{req},
23             username => $username,
24             os => $os,
25             )
26             );
27             }
28              
29              
30             sub reply_with_error
31             {
32 3     3 1 21 my($self, $error_type) = @_;
33 3         67 $self->{cb}->(
34             AnyEvent::Ident::Response->new(
35             req => $self->{req},
36             error_type => $error_type,
37             )
38             );
39             }
40              
41              
42 0     0 1   sub remote_port { shift->{remote_port} }
43 0     0 1   sub local_port { shift->{local_port} }
44              
45              
46 0     0 1   sub remote_address { shift->{remote_address} }
47              
48             1;
49              
50             __END__