| 1 | ##---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 2 | ## CSS Object Oriented - ~/lib/CSS/Object/Comment.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::Comment; | ||||||||||||||||||||||||||||
| 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 | use overload ( | ||||||||||||||||||||||||||||
| 18 | 6 | '""' => 'as_string', | |||||||||||||||||||||||||||
| 19 | fallback => 1, | ||||||||||||||||||||||||||||
| 20 | 6 | ▶ | ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 6 | ▶ | our $VERSION = 'v0.1.0'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | }; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | sub init | ||||||||||||||||||||||||||||
| 25 | { | ||||||||||||||||||||||||||||
| 26 | 8 | ▶ | my $self = shift( @_ ); | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 27 | 8 | my $this = shift( @_ ); | |||||||||||||||||||||||||||
| 28 | 8 | ▶ | if( CORE::length( $this ) && $self->_is_array( $this ) ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
length $this and $self->_is_array($this)
MC/DC50%1/2
length $this and $self->_is_array($this)
length $this
$self->_is_array($this)
Truth table66%2/3
A and B
A= length $thisB= $self->_is_array($this)
| |||||||||||||||||||||||||||||
| 29 | { | ||||||||||||||||||||||||||||
| 30 | 5 | $self->values->push( @$this ); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | else | ||||||||||||||||||||||||||||
| 33 | { | ||||||||||||||||||||||||||||
| 34 | 3 | $self->values->push( $this ); | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | 8 | $self->SUPER::init( @_ ); | |||||||||||||||||||||||||||
| 37 | 8 | return( $self ); | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | sub as_string | ||||||||||||||||||||||||||||
| 41 | { | ||||||||||||||||||||||||||||
| 42 | 48 | ▶ | my $self = shift( @_ ); | ||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 48 | return( $self->format->comment_as_string( $self ) ); | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 56 | ▶ | sub values { return( shift->_set_get_object_array_object( 'values', 'CSS::Object::Value', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
values: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 6 | 1; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | __END__ | ||||||||||||||||||||||||||||