| 1 | package WebDyne::Cloudflare::KV::Blob; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use 5.020; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use MIME::Base64 qw(encode_base64); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 3 | our $VERSION='0.001'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 22 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 22 | my ($class, $bytes)=@_; | |||||||||||||||||||||||||||
| 12 | 22 | ▶ | die "KV blob requires a defined byte string\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not defined $bytes or ref $bytes
MC/DC100%2/2
not defined $bytes or ref $bytes
not defined $bytes
ref $bytes
Truth table100%3/3
not(A) or B
A= not defined $bytesB= ref $bytes
| |||||||||||||||||||||||||||||
| 13 | if (!defined($bytes)||ref($bytes)); | ||||||||||||||||||||||||||||
| 14 | 19 | ▶ | die "KV blob requires bytes, not wide characters\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | unless utf8::downgrade($bytes, 1); | ||||||||||||||||||||||||||||
| 16 | 18 | my $self=bless(\$bytes, $class); | |||||||||||||||||||||||||||
| 17 | 18 | return $self; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 18 | ▶ | sub wire_value { | ||||||||||||||||||||||||||
|
Subroutine
wire_value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 18 | my ($self)=@_; | |||||||||||||||||||||||||||
| 23 | 18 | return { type => 'bytes', base64 => encode_base64(${$self}, '') }; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 3 | 1; | |||||||||||||||||||||||||||