File Coverage

blib/lib/Protocol/OTR/Channel.pm
Criterion Covered Total %
statement 13 26 50.0
branch n/a
condition n/a
subroutine 5 9 55.5
pod 2 2 100.0
total 20 37 54.0


line stmt bran cond sub pod time code
1             # ABSTRACT: Off-the-Record communication Channel
2             package Protocol::OTR::Channel;
3             BEGIN {
4 4     4   132 $Protocol::OTR::Channel::AUTHORITY = 'cpan:AJGB';
5             }
6             $Protocol::OTR::Channel::VERSION = '0.04';
7 4     4   17 use strict;
  4         3  
  4         102  
8 4     4   15 use warnings;
  4         4  
  4         81  
9 4     4   15 use Scalar::Util ();
  4         3  
  4         93  
10 4     4   15 use Protocol::OTR ();
  4         4  
  4         748  
11              
12             sub _new {
13 0     0     my ($class, $cnt, $args) = @_;
14              
15 0           $args->{selected_instag} = Protocol::OTR::INSTAG_BEST();
16 0           $args->{known_sessions} = {};
17 0           $args->{gone_secure} = 0;
18              
19 0           my $self = bless $args, $class;
20 0           $self->{cnt} = $cnt;
21              
22 0           return $self;
23             }
24              
25             sub account {
26 0     0 1   return $_[0]->{cnt}->{act};
27             }
28              
29             sub contact {
30 0     0 1   return $_[0]->{cnt};
31             }
32              
33             sub _ev {
34 0     0     my ($self, $cb_name) = (shift, shift);
35              
36             {
37 0           Scalar::Util::weaken(my $this = $self);
  0            
38 0           $this->{$cb_name}->($this, @_);
39             }
40             }
41              
42              
43             1;
44              
45             __END__