Object/Selector.pm

filter: Statementstmt 96.4% 27 / 28 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 88.8% 8 / 9 Podpod 100% 4 / 4 totaltotal 89.1% 41 / 46 CC 3 SCAR 5.0
CC
3
Cov
91%
add_to
3.1
as_string
2.0
BEGIN
1.0
CRAP 1.7
« Object/Parser.pm ↑ Summary Object/Comment.pm »
1 ##----------------------------------------------------------------------------
2 ## CSS Object Oriented - ~/lib/CSS/Object/Selector.pm
3 ## Version v0.1.0
4 ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <@sitael.local>
6 ## Created 2020/06/21
7 ## Modified 2020/06/21
8 ##
9 ##----------------------------------------------------------------------------
10 package CSS::Object::Selector;
11 BEGIN
12 {
13 6 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 6 ▶ use parent qw( CSS::Object::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
16 6 ▶ use Devel::Confess;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 6 ▶ our $VERSION = 'v0.1.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
18 };
19  
20 sub init
21 {
22 48 ▶ my $self = shift( @_ );
Subroutine init: called CC=1 SCAR=0.0
Pod documented
23 48 $self->{name} = '';
24 48 $self->{format} = '';
25 48 $self->{_init_strict_use_sub} = 1;
26 48 $self->SUPER::init( @_ );
27 48 return( $self );
28 }
29  
30 ## Inherited
31 ## sub format
32  
33 sub add_to
34 {
35 14 ▶ my $self = shift( @_ );
Subroutine add_to: called CC=3 SCAR=11.2
Pod documented
36 14 ▶ my $rule = shift( @_ ) || return( $self->error( "No rule object was provided to add our selctor to it." ) );
Condition50%1/2
shift @_ || (return $self->error('No rule object was provided to add our selctor to it.'))
l!l
140
MC/DC0%0/1
shift @_ || (return $self->error('No rule object was provided to add our selctor to it.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
37 14 ▶ return( $self->error( "Rule object provided (", overload::StrVal( $rule ), ") is not actually a CSS::Object::Rule object." ) ) if( !$self->_is_a( $rule, 'CSS::Object::Rule' ) );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_is_a($rule, "CSS::Object::Rule") 0 14 14
38 14 $self->format->indent( $rule->format->indent );
39 14 $rule->add_selector( $self );
40 14 return( $self );
41 }
42  
43 0 ▶sub as_string { return( shift->name ); }
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
44  
45 468 ▶sub name { return( shift->_set_get_scalar_as_object( 'name', @_ ) ); }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
46  
47 6 1;
48  
49 __END__
« Object/Parser.pm ↑ Summary Object/Comment.pm »