blib/lib/Protocol/OTR/Channel.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 100% 39 / 39 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Protocol/OTR.pm ↑ Summary blib/lib/Protocol/OTR/Fingerprint.pm »
1 # ABSTRACT: Off-the-Record communication Channel
2 package Protocol::OTR::Channel;
3 8 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 $Protocol::OTR::Channel::AUTHORITY = 'cpan:AJGB';
5 }
6 8 $Protocol::OTR::Channel::VERSION = '0.05';
7 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 8 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 8 ▶use Protocol::OTR ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 ▶sub _new {
Subroutine _new: called CC=1 SCAR=0.0
13 3 my ($class, $cnt, $args) = @_;
14  
15 3 $args->{selected_instag} = Protocol::OTR::INSTAG_BEST();
16 3 $args->{known_sessions} = {};
17 3 $args->{gone_secure} = 0;
18  
19 3 my $self = bless $args, $class;
20 3 $self->{cnt} = $cnt;
21  
22 3 return $self;
23 }
24  
25 114 ▶sub account {
Subroutine account: called CC=1 SCAR=0.0
Pod documented
26 114 return $_[0]->{cnt}->{act};
27 }
28  
29 118 ▶sub contact {
Subroutine contact: called CC=1 SCAR=0.0
Pod documented
30 118 return $_[0]->{cnt};
31 }
32  
33 114 ▶sub _ev {
Subroutine _ev: called CC=1 SCAR=0.0
34 114 my ($self, $cb_name) = (shift, shift);
35  
36 {
37 114 Scalar::Util::weaken(my $this = $self);
38 114 $this->{$cb_name}->($this, @_);
39 }
40 }
41  
42  
43 8 1;
44  
45 __END__
« blib/lib/Protocol/OTR.pm ↑ Summary blib/lib/Protocol/OTR/Fingerprint.pm »