Voice/Call.pm

filter: Statementstmt 50.0% 11 / 22 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 42.1% 16 / 38 CC 3 SCAR 17.7
CC
3
Cov
38%
cancel
12.0
new
2.0
BEGIN
1.0
CRAP 5.9
« Voice/Feed.pm ↑ Summary Voice/SMS/Message.pm »
1 package Google::Voice::Call;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Mojo::Base -base;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 __PACKAGE__->attr([qw/ from to rnr_se ua /]);
9  
10 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
11 0 my $self = bless {}, shift;
12  
13 0 $self->from(shift);
14 0 $self->to(shift);
15 0 $self->rnr_se(shift);
16 0 $self->ua(shift);
17  
18 0 return $self;
19 }
20  
21 0 ▶sub cancel {
Subroutine cancel: not called CC=3 SCAR=24.8
Pod documented
22 0 my $self = shift;
23 0 my ($from, $to) = @_;
24  
25 0 my $json = $self->ua->post(
26 'https://www.google.com/voice/call/cancel/' => form => {
27 forwardingNumber => undef,
28 outgoingNumber => undef,
29 cancelType => 'C2C',
30 _rnr_se => $self->rnr_se
31 }
32 )->res->json;
33  
34 0 ▶ $@ = $json->{data}->{code} and return unless $json->{ok};
Branch: 1 branch
BranchTrueFalseTotal
unless $json->{"ok"} 0 0 0
Condition0%0/5
$json->{'ok'} || ($@ = $json->{'data'}{'code'}) && (return)
l!l&&r!l&&!r
000
$@ = $json->{"data"}{"code"} and return
!ll
00
MC/DC0%0/2
$json->{'ok'} || ($@ = $json->{'data'}{'code'}) && (return)
$json->{'ok'} $@ = $json->{"data"}{"code"}
Truth table0%0/3
A || B
A= $json->{'ok'}B= $@ = $json->{"data"}{"code"}
ABresult
1X1
011
000
35  
36 0 return $json->{ok};
37 }
38  
39 1 1;
40  
41 =head1 NAME
42  
43 Google::Voice::Call
44  
45 =head1 DESCRIPTION
46  
47 Object representing active phone call
48  
49 =head1 ATTRIBUTES
50  
51 =head2 from
52  
53 Calling from phone number
54  
55 =head2 to
56  
57 Calling to phone number
58  
59 =head1 METHODS
60  
61 =head2 new
62  
63 =head2 cancel
64  
65 Cancel connected phone call
66  
67 =cut
« Voice/Feed.pm ↑ Summary Voice/SMS/Message.pm »