| 1 | ##---------------------------------------------------------------------------- | ||||||||||||
| 2 | ## CSS Object Oriented - ~/lib/CSS/Object/Parser.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::Parser; | ||||||||||||
| 11 | BEGIN | ||||||||||||
| 12 | { | ||||||||||||
| 13 | 4 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | 4 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | 4 | ▶ | use parent qw( Module::Generic ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 4 | ▶ | use Devel::Confess; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 17 | 4 | ▶ | our $VERSION = 'v0.1.0'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | }; | ||||||||||||
| 19 | |||||||||||||
| 20 | sub init | ||||||||||||
| 21 | { | ||||||||||||
| 22 | 6 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
init: called CC=4 SCAR=14.3
Pod
documented
| |||||||||||||
| 23 | 6 | ▶ | my $css = shift( @_ ) || | ||||||||||
|
Condition50%1/2
shift @_ || (return $self->error('No CSS object provided.'))
MC/DC0%0/1
shift @_ || (return $self->error('No CSS object provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
| |||||||||||||
| 24 | return( $self->error( "No CSS object provided." ) ); | ||||||||||||
| 25 | 6 | ▶ | return( $self->error( "CSS object provded is actually not a CSS::Object object." ) ) if( !$self->_is_a( $css, 'CSS::Object' ) ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 6 | $self->{_init_strict_use_sub} = 1; | |||||||||||
| 27 | 6 | $self->SUPER::init( @_ ); | |||||||||||
| 28 | 6 | ▶ | $self->css( $css ) || return( $self->pass_error ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 6 | return( $self ); | |||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | 24 | ▶ | sub css { return( shift->_set_get_object( 'css', 'CSS::Object', @_ ) ); } | ||||||||||
|
Subroutine
css: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 33 | |||||||||||||
| 34 | 0 | ▶ | sub parse_string { return( shift->error( "You cannot use this class directly. Please use one of the Parser subclasses." ) ); } | ||||||||||
|
Subroutine
parse_string: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 35 | |||||||||||||
| 36 | 4 | 1; | |||||||||||
| 37 | |||||||||||||
| 38 | __END__ | ||||||||||||