| 1 | ##---------------------------------------------------------------------------- | ||||||||||||||||||||
| 2 | ## WebSocket Client & Server - ~/lib/WebSocket/Handshake.pm | ||||||||||||||||||||
| 3 | ## Version v0.1.0 | ||||||||||||||||||||
| 4 | ## Copyright(c) 2021 DEGUEST Pte. Ltd. | ||||||||||||||||||||
| 5 | ## Author: Jacques Deguest <jack@deguest.jp> | ||||||||||||||||||||
| 6 | ## Created 2021/09/17 | ||||||||||||||||||||
| 7 | ## Modified 2021/09/17 | ||||||||||||||||||||
| 8 | ## You can use, copy, modify and redistribute this package and associated | ||||||||||||||||||||
| 9 | ## files under the same terms as Perl itself. | ||||||||||||||||||||
| 10 | ##---------------------------------------------------------------------------- | ||||||||||||||||||||
| 11 | package WebSocket::Handshake; | ||||||||||||||||||||
| 12 | BEGIN | ||||||||||||||||||||
| 13 | 2 | ▶ | { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 2 | ▶ | use parent qw( WebSocket ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | 2 | ▶ | use vars qw( $VERSION ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 2 | our $VERSION = 'v0.1.0'; | |||||||||||||||||||
| 19 | }; | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | sub init | ||||||||||||||||||||
| 22 | 1 | ▶ | { | ||||||||||||||||||
|
Subroutine
init: called CC=8 SCAR=22.8
Pod
documented
| |||||||||||||||||||||
| 23 | 1 | my $self = shift( @_ ); | |||||||||||||||||||
| 24 | 1 | ▶ | $self->{request} = undef unless( defined( $self->{request} ) ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | 1 | ▶ | $self->{response} = undef unless( defined( $self->{response} ) ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 1 | ▶ | $self->{uri} = undef unless( defined( $self->{uri} ) ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 27 | 1 | ▶ | $self->{version} = '' unless( length( $self->{version} // '' ) ); | ||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->{"version"} // ""
MC/DC0%0/1
$self->{"version"} // ""
$self->{"version"}
Truth table50%1/2
A
A= $self->{"version"}
| |||||||||||||||||||||
| 28 | 1 | ▶ | $self->{_exception_class} = 'WebSocket::Exception' unless( defined( $self->{_exception_class} ) ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | 1 | $self->{_init_strict_use_sub} = 1; | |||||||||||||||||||
| 30 | 1 | ▶ | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | 1 | return( $self ); | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 6 | ▶ | sub request { return( shift->_set_get_object( 'request', 'WebSocket::Request', @_ ) ); } | ||||||||||||||||||
|
Subroutine
request: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 2 | ▶ | sub response { return( shift->_set_get_object( 'response', 'WebSocket::Response', @_ ) ); } | ||||||||||||||||||
|
Subroutine
response: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 0 | ▶ | sub uri { return( shift->_set_get_uri( 'uri', @_ ) ); } | ||||||||||||||||||
|
Subroutine
uri: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 1 | ▶ | sub version { return( shift->_set_get_object_without_init( 'version', 'WebSocket::Version', @_ ) ); } | ||||||||||||||||||
|
Subroutine
version: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 2 | 1; | |||||||||||||||||||
| 43 | # NOTE: POD | ||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||