| 1 | package PAGI::Test::WebSocket; | ||||||||||||||||||||||||||||
| 2 | 5 | $PAGI::Test::WebSocket::VERSION = '0.002002'; | |||||||||||||||||||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Future::AsyncAwait; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Future; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 14 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||||||||||||||||||||
| 11 | 14 | my ($class, %args) = @_; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 14 | ▶ | croak "app is required" unless $args{app}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 14 | 14 | ▶ | croak "scope is required" unless $args{scope}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | return bless { | ||||||||||||||||||||||||||||
| 17 | app => $args{app}, | ||||||||||||||||||||||||||||
| 18 | scope => $args{scope}, | ||||||||||||||||||||||||||||
| 19 | 14 | send_queue => [], # Messages from test -> app | |||||||||||||||||||||||||||
| 20 | recv_queue => [], # Messages from app -> test | ||||||||||||||||||||||||||||
| 21 | closed => 0, | ||||||||||||||||||||||||||||
| 22 | accepted => 0, | ||||||||||||||||||||||||||||
| 23 | close_code => undef, | ||||||||||||||||||||||||||||
| 24 | close_reason => '', | ||||||||||||||||||||||||||||
| 25 | _pending_receives => [], # Pending receive futures | ||||||||||||||||||||||||||||
| 26 | }, $class; | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 14 | ▶ | sub _start { | ||||||||||||||||||||||||||
|
Subroutine
_start: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||
| 30 | 14 | my ($self) = @_; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | # Create receive coderef for the app | ||||||||||||||||||||||||||||
| 33 | 31 | ▶ | my $receive = async sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=17.6
| |||||||||||||||||||||||||||||
| 34 | # First call returns websocket.connect | ||||||||||||||||||||||||||||
| 35 | 31 | ▶ | if (!$self->{_connect_sent}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 12 | $self->{_connect_sent} = 1; | |||||||||||||||||||||||||||
| 37 | 12 | return { type => 'websocket.connect' }; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | # Return queued message if available | ||||||||||||||||||||||||||||
| 41 | 19 | ▶ | if (@{$self->{send_queue}}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 0 | return shift @{$self->{send_queue}}; | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | # Return disconnect if closed | ||||||||||||||||||||||||||||
| 46 | 19 | ▶ | if ($self->{closed}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | return { type => 'websocket.disconnect', code => $self->{close_code} // 1000 }; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"close_code"} // 1000
MC/DC0%0/1
$self->{"close_code"} // 1000
$self->{"close_code"}
Truth table0%0/2
A
A= $self->{"close_code"}
| |||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | # Create a future that will be resolved when data arrives | ||||||||||||||||||||||||||||
| 51 | 19 | my $future = Future->new; | |||||||||||||||||||||||||||
| 52 | 19 | push @{$self->{_pending_receives}}, $future; | |||||||||||||||||||||||||||
| 53 | 19 | return await $future; | |||||||||||||||||||||||||||
| 54 | 14 | }; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | # Create send coderef for the app | ||||||||||||||||||||||||||||
| 57 | 28 | ▶ | my $send = async sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=18.0
| |||||||||||||||||||||||||||||
| 58 | 28 | my ($event) = @_; | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 28 | ▶ | if ($event->{type} eq 'websocket.accept') { | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 61 | 14 | $self->{accepted} = 1; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | elsif ($event->{type} eq 'websocket.send') { | ||||||||||||||||||||||||||||
| 64 | 11 | push @{$self->{recv_queue}}, $event; | |||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | elsif ($event->{type} eq 'websocket.close') { | ||||||||||||||||||||||||||||
| 67 | 2 | $self->{closed} = 1; | |||||||||||||||||||||||||||
| 68 | 2 | ▶ | $self->{close_code} = $event->{code} // 1000; | ||||||||||||||||||||||||||
|
Condition50%1/2
$event->{"code"} // 1000
MC/DC0%0/1
$event->{"code"} // 1000
$event->{"code"}
Truth table50%1/2
A
A= $event->{"code"}
| |||||||||||||||||||||||||||||
| 69 | 2 | ▶ | $self->{close_reason} = $event->{reason} // ''; | ||||||||||||||||||||||||||
|
Condition50%1/2
$event->{"reason"} // ""
MC/DC0%0/1
$event->{"reason"} // ""
$event->{"reason"}
Truth table50%1/2
A
A= $event->{"reason"}
| |||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 28 | return; | |||||||||||||||||||||||||||
| 73 | 14 | }; | |||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | # Start the app future but don't block on it | ||||||||||||||||||||||||||||
| 76 | 14 | $self->{app_future} = $self->{app}->($self->{scope}, $receive, $send); | |||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | # Wait for acceptance (the first two awaits in the app should complete immediately) | ||||||||||||||||||||||||||||
| 79 | # This is a bit hacky but works: we need to let the app run until it accepts | ||||||||||||||||||||||||||||
| 80 | 14 | $self->_pump_app; | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 14 | ▶ | croak "WebSocket connection not accepted" unless $self->{accepted}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 14 | return $self; | |||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 34 | ▶ | sub _pump_app { | ||||||||||||||||||||||||||
|
Subroutine
_pump_app: called CC=7 SCAR=21.5
| |||||||||||||||||||||||||||||
| 88 | 34 | my ($self) = @_; | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | # This pumps the app future by checking if it's waiting on a receive | ||||||||||||||||||||||||||||
| 91 | # If there are pending receives and we have data, resolve them | ||||||||||||||||||||||||||||
| 92 | 34 | ▶ | while (@{$self->{_pending_receives}} && @{$self->{send_queue}}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@{$self->{"_pending_receives"};} and @{$self->{"send_queue"};}
MC/DC100%2/2
@{$self->{"_pending_receives"};} and @{$self->{"send_queue"};}
@{$self->{"_pending_receives"};}
@{$self->{"send_queue"};}
Truth table100%3/3
A and B
A= @{$self->{"_pending_receives"};}B= @{$self->{"send_queue"};}
| |||||||||||||||||||||||||||||
| 93 | 19 | my $future = shift @{$self->{_pending_receives}}; | |||||||||||||||||||||||||||
| 94 | 19 | my $event = shift @{$self->{send_queue}}; | |||||||||||||||||||||||||||
| 95 | 19 | $future->done($event); | |||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | # If closed and there are pending receives, resolve them with disconnect | ||||||||||||||||||||||||||||
| 99 | 34 | ▶ | if ($self->{closed} && @{$self->{_pending_receives}}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->{"closed"} and @{$self->{"_pending_receives"};}
MC/DC0%0/2
$self->{"closed"} and @{$self->{"_pending_receives"};}
$self->{"closed"}
@{$self->{"_pending_receives"};}
Truth table66%2/3
A and B
A= $self->{"closed"}B= @{$self->{"_pending_receives"};}
| |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | while (my $future = shift @{$self->{_pending_receives}}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | $future->done({ type => 'websocket.disconnect', code => $self->{close_code} // 1000 }); | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"close_code"} // 1000
MC/DC0%0/1
$self->{"close_code"} // 1000
$self->{"close_code"}
Truth table0%0/2
A
A= $self->{"close_code"}
| |||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 8 | ▶ | sub send_text { | ||||||||||||||||||||||||||
|
Subroutine
send_text: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 107 | 8 | my ($self, $text) = @_; | |||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 8 | ▶ | croak "Cannot send on closed WebSocket" if $self->{closed}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | 7 | push @{$self->{send_queue}}, { | |||||||||||||||||||||||||||
| 112 | type => 'websocket.receive', | ||||||||||||||||||||||||||||
| 113 | text => $text, | ||||||||||||||||||||||||||||
| 114 | }; | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | # Pump the app to process this message | ||||||||||||||||||||||||||||
| 117 | 7 | $self->_pump_app; | |||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | 7 | return $self; | |||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | 1 | ▶ | sub send_bytes { | ||||||||||||||||||||||||||
|
Subroutine
send_bytes: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||
| 123 | 1 | my ($self, $bytes) = @_; | |||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | 1 | ▶ | croak "Cannot send on closed WebSocket" if $self->{closed}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | 1 | push @{$self->{send_queue}}, { | |||||||||||||||||||||||||||
| 128 | type => 'websocket.receive', | ||||||||||||||||||||||||||||
| 129 | bytes => $bytes, | ||||||||||||||||||||||||||||
| 130 | }; | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | # Pump the app to process this message | ||||||||||||||||||||||||||||
| 133 | 1 | $self->_pump_app; | |||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | 1 | return $self; | |||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | 1 | ▶ | sub send_json { | ||||||||||||||||||||||||||
|
Subroutine
send_json: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 139 | 1 | my ($self, $data) = @_; | |||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||
| 141 | 1 | require JSON::MaybeXS; | |||||||||||||||||||||||||||
| 142 | 1 | my $text = JSON::MaybeXS::encode_json($data); | |||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | 1 | return $self->send_text($text); | |||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | 11 | ▶ | sub receive_text { | ||||||||||||||||||||||||||
|
Subroutine
receive_text: called CC=6 SCAR=18.4
Pod
documented
| |||||||||||||||||||||||||||||
| 148 | 11 | my ($self, $timeout) = @_; | |||||||||||||||||||||||||||
| 149 | 11 | ▶ | $timeout //= 5; | ||||||||||||||||||||||||||
|
Condition100%2/2
$timeout //= 5
MC/DC100%1/1
$timeout //= 5
$timeout
Truth table100%2/2
A
A= $timeout
| |||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | # Check if we have a text message already waiting | ||||||||||||||||||||||||||||
| 152 | 11 | for my $i (0 .. $#{$self->{recv_queue}}) { | |||||||||||||||||||||||||||
| 153 | 10 | my $event = $self->{recv_queue}[$i]; | |||||||||||||||||||||||||||
| 154 | 10 | ▶ | if ($event->{type} eq 'websocket.send' && exists $event->{text}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$event->{"type"} eq "websocket.send" and exists $event->{"text"}
MC/DC0%0/2
$event->{"type"} eq "websocket.send" and exists $event->{"text"}
$event->{"type"} eq "websocket.send"
exists $event->{"text"}
Truth table33%1/3
A and B
A= $event->{"type"} eq "websocket.send"B= exists $event->{"text"}
| |||||||||||||||||||||||||||||
| 155 | 10 | splice @{$self->{recv_queue}}, $i, 1; | |||||||||||||||||||||||||||
| 156 | 10 | return $event->{text}; | |||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | # Check if connection closed | ||||||||||||||||||||||||||||
| 161 | 1 | ▶ | return undef if $self->{closed}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | # No message available yet | ||||||||||||||||||||||||||||
| 164 | 1 | croak "Timeout waiting for WebSocket text message"; | |||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | 1 | ▶ | sub receive_bytes { | ||||||||||||||||||||||||||
|
Subroutine
receive_bytes: called CC=6 SCAR=21.2
Pod
documented
| |||||||||||||||||||||||||||||
| 168 | 1 | my ($self, $timeout) = @_; | |||||||||||||||||||||||||||
| 169 | 1 | ▶ | $timeout //= 5; | ||||||||||||||||||||||||||
|
Condition50%1/2
$timeout //= 5
MC/DC0%0/1
$timeout //= 5
$timeout
Truth table50%1/2
A
A= $timeout
| |||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | # Check if we have a bytes message waiting | ||||||||||||||||||||||||||||
| 172 | 1 | for my $i (0 .. $#{$self->{recv_queue}}) { | |||||||||||||||||||||||||||
| 173 | 1 | my $event = $self->{recv_queue}[$i]; | |||||||||||||||||||||||||||
| 174 | 1 | ▶ | if ($event->{type} eq 'websocket.send' && exists $event->{bytes}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$event->{"type"} eq "websocket.send" and exists $event->{"bytes"}
MC/DC0%0/2
$event->{"type"} eq "websocket.send" and exists $event->{"bytes"}
$event->{"type"} eq "websocket.send"
exists $event->{"bytes"}
Truth table33%1/3
A and B
A= $event->{"type"} eq "websocket.send"B= exists $event->{"bytes"}
| |||||||||||||||||||||||||||||
| 175 | 1 | splice @{$self->{recv_queue}}, $i, 1; | |||||||||||||||||||||||||||
| 176 | 1 | return $event->{bytes}; | |||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | # Check if connection closed | ||||||||||||||||||||||||||||
| 181 | 0 | ▶ | return undef if $self->{closed}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | # No message available yet | ||||||||||||||||||||||||||||
| 184 | 0 | croak "Timeout waiting for WebSocket bytes message"; | |||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||
| 187 | 2 | ▶ | sub receive_json { | ||||||||||||||||||||||||||
|
Subroutine
receive_json: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||
| 188 | 2 | my ($self, $timeout) = @_; | |||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | 2 | my $text = $self->receive_text($timeout); | |||||||||||||||||||||||||||
| 191 | 2 | ▶ | return undef unless defined $text; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | 2 | require JSON::MaybeXS; | |||||||||||||||||||||||||||
| 194 | 2 | return JSON::MaybeXS::decode_json($text); | |||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 12 | ▶ | sub close { | ||||||||||||||||||||||||||
|
Subroutine
close: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 198 | 12 | my ($self, $code, $reason) = @_; | |||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | 12 | ▶ | return if $self->{closed}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | 12 | ▶ | $code //= 1000; | ||||||||||||||||||||||||||
|
Condition100%2/2
$code //= 1000
MC/DC100%1/1
$code //= 1000
$code
Truth table100%2/2
A
A= $code
| |||||||||||||||||||||||||||||
| 203 | 12 | ▶ | $reason //= ''; | ||||||||||||||||||||||||||
|
Condition100%2/2
$reason //= ""
MC/DC100%1/1
$reason //= ""
$reason
Truth table100%2/2
A
A= $reason
| |||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||
| 205 | 12 | $self->{closed} = 1; | |||||||||||||||||||||||||||
| 206 | 12 | $self->{close_code} = $code; | |||||||||||||||||||||||||||
| 207 | 12 | $self->{close_reason} = $reason; | |||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | # Push disconnect event | ||||||||||||||||||||||||||||
| 210 | 12 | push @{$self->{send_queue}}, { | |||||||||||||||||||||||||||
| 211 | type => 'websocket.disconnect', | ||||||||||||||||||||||||||||
| 212 | code => $code, | ||||||||||||||||||||||||||||
| 213 | reason => $reason, | ||||||||||||||||||||||||||||
| 214 | }; | ||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | # Pump the app to let it process the disconnect | ||||||||||||||||||||||||||||
| 217 | 12 | $self->_pump_app; | |||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | 12 | return $self; | |||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | 2 | ▶ | sub close_code { | ||||||||||||||||||||||||||
|
Subroutine
close_code: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 223 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||
| 224 | 2 | return $self->{close_code}; | |||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||
| 227 | 1 | ▶ | sub close_reason { | ||||||||||||||||||||||||||
|
Subroutine
close_reason: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 228 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||
| 229 | 1 | return $self->{close_reason}; | |||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | 14 | ▶ | sub is_closed { | ||||||||||||||||||||||||||
|
Subroutine
is_closed: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 233 | 14 | my ($self) = @_; | |||||||||||||||||||||||||||
| 234 | 14 | return $self->{closed}; | |||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||
| 237 | 5 | 1; | |||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | __END__ | ||||||||||||||||||||||||||||