lib/HTML/Object/XPath/Variable.pm

filter: Statementstmt 55.0% 22 / 40 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 53.8% 7 / 13 Podpod 100% 6 / 6 totaltotal 57.3% 35 / 61 CC 2 SCAR 7.3
CC
2
Cov
52%
init
6.0
as_string
2.0
as_xml
2.0
CRAP 2.1
« lib/HTML/Object/DOM/TrackEvent.pm ↑ Summary lib/HTML/Object/DOM/TextTrackCue.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/XPath/Variable.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/12/05
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::XPath::Variable;
15 BEGIN
16 {
17 14 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 14 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 14 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 14 ▶ use parent qw( Module::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 14 ▶ use vars qw( $DEBUG $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 14 our $DEBUG = 0;
23 14 our $VERSION = 'v0.2.0';
24 };
25  
26 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 0 ▶ my $self = shift( @_ );
Subroutine init: not called CC=2 SCAR=17.9
Pod documented
32 0 $self->{path_parser} = shift( @_ );
33 0 $self->{name} = shift( @_ );
34 0 $self->{_init_strict_use_sub} = 1;
35 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
36 0 return( $self );
37 }
38  
39 sub as_string
40 {
41 0 ▶ my $self = shift( @_ );
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
42 0 return( '\$' . $self->{name} );
43 }
44  
45 sub as_xml
46 {
47 0 ▶ my $self = shift( @_ );
Subroutine as_xml: not called CC=1 SCAR=6.9
Pod documented
48 0 return( "<Variable>" . $self->{name} . "</Variable>\n" );
49 }
50  
51 sub get_value
52 {
53 0 ▶ my $self = shift( @_ );
Subroutine get_value: not called CC=1 SCAR=6.9
Pod documented
54 0 return( $self->{path_parser}->get_var( $self->{name} ) );
55 }
56  
57 sub set_value
58 {
59 0 ▶ my $self = shift( @_ );
Subroutine set_value: not called CC=1 SCAR=6.9
Pod documented
60 0 my $val = shift( @_ );
61 0 return( $self->{path_parser}->set_var( $self->{name} => $val ) );
62 }
63  
64 sub evaluate
65 {
66 0 ▶ my $self = shift( @_ );
Subroutine evaluate: not called CC=1 SCAR=6.9
Pod documented
67 0 my $val = $self->get_value;
68 0 return( $val );
69 }
70  
71 14 1;
72 # NOTE: POD
73 __END__
« lib/HTML/Object/DOM/TrackEvent.pm ↑ Summary lib/HTML/Object/DOM/TextTrackCue.pm »