blib/lib/HTML/Object/Space.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 58 CC 2 SCAR 9.6
CC
2
Cov
0%
as_string
6.0
BEGIN
2.0
init
2.0
CRAP 2.6
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/Space.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/04/19
7 ## Modified 2022/09/18
8 ## All rights reserved.
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::Space;
15 BEGIN
16 {
17 use strict;
18 use warnings;
19 warnings::register_categories( 'HTML::Object' );
20 use parent qw( HTML::Object::Element );
21 use vars qw( $VERSION );
22 our $VERSION = 'v0.2.0';
23 };
24  
25 use strict;
26 use warnings;
27  
28 sub init
29 {
30 my $self = shift( @_ );
31 $self->{is_empty} = 1;
32 $self->{tag} = '_space';
33 $self->{value} = undef;
34 $self->{_init_strict_use_sub} = 1;
35 $self->{_exception_class} = 'HTML::Object::Exception';
36 $self->SUPER::init( @_ ) || return( $self->pass_error );
37 return( $self );
38 }
39  
40 sub as_string
41 {
42 my $self = shift( @_ );
43 # We need to remove the reset flag, otherwise if there are any subsequent change that need to be propagated to this space parent, HTML::Object::Element::reset will not propagate it
44 $self->_remove_reset;
45 return( $self->value->length ? $self->value : $self->original );
46 }
47  
48 sub as_xml { return( shift->as_string( @_ ) ); }
49  
50 sub set_checksum
51 {
52 my $self = shift( @_ );
53 return( $self->_get_md5_hash( $self->value->scalar ) );
54 }
55  
56 sub value : lvalue { return( shift->_set_get_scalar_as_object( 'value', @_ ) ); }
57 # {
58 # my $self = shift( @_ );
59 # if( @_ )
60 # {
61 # return( $self->_set_get_scalar_as_object( 'value', @_ ) );
62 # }
63 # my $val = $self->_set_get_scalar_as_object( 'value' );
64 # return( $val ) if( defined( $val ) && $val->defined );
65 # return( $self->original );
66 # }
67  
68 1;
69 # NOTE: POD
70 __END__