lib/DB/Object/Fields/Overloaded.pm

filter: Statementstmt 100% 34 / 34 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 100% 2 / 2 totaltotal 98.0% 49 / 50 CC 2 SCAR 1.4
CC
2
Cov
97%
init
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« lib/DB/Object/Postgres.pm ↑ Summary lib/DB/Object/Postgres/Statement.pm »
1 ##----------------------------------------------------------------------------
2 ## Database Object Interface - ~/lib/DB/Object/Fields/Overloaded.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2023 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2020/01/01
7 ## Modified 2026/03/22
8 ## All rights reserved
9 ##
10 ## This program is free software; you can redistribute it and/or modify it
11 ## under the same terms as Perl itself.
12 ##----------------------------------------------------------------------------
13 package DB::Object::Fields::Overloaded;
14 BEGIN
15 4 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 4 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 4 warnings::register_categories( 'DB::Object' );
19 4 ▶ use parent qw( DB::Object::Query::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 4 ▶ use vars qw( $VERSION $EXCEPTION_CLASS );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 4 ▶ use overload (
Subroutine BEGIN: called CC=1 SCAR=0.0
22 20 ▶ '""' => sub{ return( $_[0]->{expression} ) },
Subroutine __ANON__: called CC=1 SCAR=0.0
23 60 ▶ 'bool' => sub{1},
Subroutine __ANON__: called CC=1 SCAR=0.0
24 4 fallback => 1,
25 4 );
26 4 our $EXCEPTION_CLASS = $DB::Object::EXCEPTION_CLASS;
27 4 our $VERSION = 'v0.2.0';
28 };
29  
30 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 sub init
34 20 ▶{
Subroutine init: called CC=2 SCAR=7.0
Pod documented
35 20 my $self = shift( @_ );
36 20 $self->{expression} = undef;
37 20 $self->{_init_strict_use_sub} = 1;
38 20 $self->{_exception_class} = $EXCEPTION_CLASS;
39 20 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 20 0 20
40 20 return( $self );
41 }
42  
43 # sub binded { return( shift->{binded} ); }
44  
45 # For example, if a placeholder was $1 (PostgreSQL), or ?1 (SQLite), the binded_offset value would be 1
46 # sub binded_offset { return( shift->{binded_offset} ); }
47  
48 20 ▶sub expression { return( shift->_set_get_scalar( 'expression', @_ ) ); }
Subroutine expression: called CC=1 SCAR=0.0
Pod documented
49  
50 4 1;
51 # NOTE: POD
52 __END__
« lib/DB/Object/Postgres.pm ↑ Summary lib/DB/Object/Postgres/Statement.pm »