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 3     3   22 use strict;
  3         3  
  3         74  
4 3     3   9 use warnings;
  3         3  
  3         44  
5 3     3   8 use AnyEvent::Ident::Response;
  3         3  
  3         420  
6              
7             # ABSTRACT: Simple asynchronous ident transaction
8             our $VERSION = '0.07'; # VERSION
9              
10              
11 9     9 1 54 sub req { shift->{req} }
12              
13              
14             sub reply_with_user
15             {
16 4     4 1 21 my $self = shift;
17 4         5 my $username = pop;
18 4         5 my $os = shift;
19 4 50       12 $os = 'OTHER' unless defined $os;
20 4         25 $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 15 my($self, $error_type) = @_;
33 3         36 $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__