Ext/MsgPack/RPC/Response.pm

filter: Statementstmt 60.0% 12 / 20 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 50.0% 17 / 34 CC 3 SCAR 13.5
CC
3
Cov
48%
new
6.0
send
6.0
BEGIN
1.0
CRAP 3.9
« Ext/Buffers.pm ↑ Summary Ext/MsgPack/RPC/EventLoop.pm »
1 package Neovim::Ext::MsgPack::RPC::Response;
2 57 $Neovim::Ext::MsgPack::RPC::Response::VERSION = '0.01';
3 57 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 57 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 57 ▶use base qw/Class::Accessor/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 57 __PACKAGE__->mk_accessors (qw/msgpack_stream request_id/);
7  
8  
9 sub new
10 {
11 0 ▶ my ($this, $msgpack_stream, $request_id) = @_;
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
12  
13 0 ▶ my $class = ref ($this) || $this;
Condition0%0/3
ref $this || $this
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table0%0/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
14 0 my $self =
15 {
16 msgpack_stream => $msgpack_stream,
17 request_id => $request_id,
18 };
19  
20 0 return bless $self, $class;
21 }
22  
23  
24  
25 sub send
26 {
27 0 ▶ my ($this, $value, $error) = @_;
Subroutine send: not called CC=2 SCAR=17.9
Pod documented
28  
29 0 ▶ if ($error)
Branch: 1 branch
BranchTrueFalseTotal
if ($error) { } 0 0 0
30 {
31 0 $this->msgpack_stream->send ([1, $this->request_id, $value, undef]);
32 }
33 else
34 {
35 0 $this->msgpack_stream->send ([1, $this->request_id, undef, $value]);
36 }
37 }
38  
39 =head1 NAME
40  
41 Neovim::Ext::MsgPack::RPC::Response - Neovim::Ext::MsgPack::RPC::Response class
42  
43 =head1 VERSION
44  
45 version 0.01
46  
47 =head1 SYNOPSIS
48  
49 use Neovim::Ext;
50  
51 =head1 METHODS
52  
53 =head2 send( $value, $error)
54  
55 Send the response. If C<$error> is true, the response will be sent as an error.
56  
57 =cut
58  
59 57 1;
« Ext/Buffers.pm ↑ Summary Ext/MsgPack/RPC/EventLoop.pm »