| 1 | ##---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 2 | ## CSS Object Oriented - ~/lib/CSS/Object/Comment.pm | ||||||||||||||||||||||||||||
| 3 | ## Version v0.2.0 | ||||||||||||||||||||||||||||
| 4 | ## Copyright(c) 2020 DEGUEST Pte. Ltd. | ||||||||||||||||||||||||||||
| 5 | ## Author: Jacques Deguest <jack@deguest.jp> | ||||||||||||||||||||||||||||
| 6 | ## Created 2020/06/21 | ||||||||||||||||||||||||||||
| 7 | ## Modified 2024/09/05 | ||||||||||||||||||||||||||||
| 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 CSS::Object::Comment; | ||||||||||||||||||||||||||||
| 14 | BEGIN | ||||||||||||||||||||||||||||
| 15 | 6 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 6 | ▶ | use parent qw( CSS::Object::Element ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 6 | ▶ | use overload ( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 6 | '""' => 'as_string', | |||||||||||||||||||||||||||
| 21 | fallback => 1, | ||||||||||||||||||||||||||||
| 22 | 6 | ); | |||||||||||||||||||||||||||
| 23 | 6 | our $VERSION = 'v0.2.0'; | |||||||||||||||||||||||||||
| 24 | }; | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | sub init | ||||||||||||||||||||||||||||
| 27 | 8 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 8 | my $self = shift( @_ ); | |||||||||||||||||||||||||||
| 29 | 8 | my $this = shift( @_ ); | |||||||||||||||||||||||||||
| 30 | 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)
| |||||||||||||||||||||||||||||
| 31 | { | ||||||||||||||||||||||||||||
| 32 | 5 | $self->values->push( @$this ); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | else | ||||||||||||||||||||||||||||
| 35 | { | ||||||||||||||||||||||||||||
| 36 | 3 | $self->values->push( $this ); | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | 8 | $self->SUPER::init( @_ ); | |||||||||||||||||||||||||||
| 39 | 8 | return( $self ); | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | sub as_string | ||||||||||||||||||||||||||||
| 43 | 27 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 44 | 27 | my $self = shift( @_ ); | |||||||||||||||||||||||||||
| 45 | 27 | return( $self->format->comment_as_string( $self ) ); | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 35 | ▶ | sub values { return( shift->_set_get_object_array_object( 'values', 'CSS::Object::Value', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
values: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 6 | 1; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||