« blib/lib/WebDyne/Cloudflare/R2/Blob.pm
↑ Summary
blib/lib/WebDyne/Cloudflare/SecretsStore/Error.pm »
| 1 | package WebDyne::Cloudflare::D1::Blob; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use 5.020; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use MIME::Base64 qw(encode_base64); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 5 | our $VERSION='0.001'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 23 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 23 | my ($class, $bytes)=@_; | |||||||||||||||||||||||||||
| 12 | 23 | ▶ | die "D1 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 | 20 | ▶ | die "D1 blob requires bytes, not wide characters\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | unless utf8::downgrade($bytes, 1); | ||||||||||||||||||||||||||||
| 16 | 19 | my $self=bless({ bytes => $bytes }, $class); | |||||||||||||||||||||||||||
| 17 | 19 | return $self; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub bytes { | ||||||||||||||||||||||||||
|
Subroutine
bytes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 0 | return shift()->{'bytes'}; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 27 | ▶ | sub wire_value { | ||||||||||||||||||||||||||
|
Subroutine
wire_value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 27 | my ($self)=@_; | |||||||||||||||||||||||||||
| 28 | return { | ||||||||||||||||||||||||||||
| 29 | type => 'blob', | ||||||||||||||||||||||||||||
| 30 | 27 | base64 => encode_base64($self->{'bytes'}, ''), | |||||||||||||||||||||||||||
| 31 | }; | ||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 5 | 1; | |||||||||||||||||||||||||||