XPath/Variable.pm

filter: Statementstmt 34.7% 8 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 25.0% 2 / 8 Podpod 0.0% 0 / 6 totaltotal 27.0% 10 / 37 CC 1 SCAR 5.6
CC
1
Cov
35%
new
2.0
as_string
2.0
as_xml
2.0
CRAP 1.8
« XPath/Literal.pm ↑ Summary XPath/Node/Text.pm »
1 package XML::XPath::Variable;
2  
3 1 $VERSION = '1.26';
4  
5 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # This class does NOT contain 1 instance of a variable
8 # see the XML::XPath::Parser class for the instances
9 # This class simply holds the name of the var
10  
11 sub new {
12 0 ▶ my $class = shift;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my ($pp, $name) = @_;
14 0 bless { name => $name, path_parser => $pp }, $class;
15 }
16  
17 sub as_string {
18 0 ▶ my $self = shift;
Subroutine as_string: not called CC=1 SCAR=6.9
Pod undocumented
19 0 '\$' . $self->{name};
20 }
21  
22 sub as_xml {
23 0 ▶ my $self = shift;
Subroutine as_xml: not called CC=1 SCAR=6.9
Pod undocumented
24 0 return "<Variable>" . $self->{name} . "</Variable>\n";
25 }
26  
27 sub get_value {
28 0 ▶ my $self = shift;
Subroutine get_value: not called CC=1 SCAR=6.9
Pod undocumented
29 0 $self->{path_parser}->get_var($self->{name});
30 }
31  
32 sub set_value {
33 0 ▶ my $self = shift;
Subroutine set_value: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my ($val) = @_;
35 0 $self->{path_parser}->set_var($self->{name}, $val);
36 }
37  
38 sub evaluate {
39 0 ▶ my $self = shift;
Subroutine evaluate: not called CC=1 SCAR=6.9
Pod undocumented
40 0 my $val = $self->get_value;
41 0 return $val;
42 }
43  
44 1 1;
« XPath/Literal.pm ↑ Summary XPath/Node/Text.pm »