| 1 | # $Id: /tree-xpathengine/trunk/lib/Tree/XPathEngine/Variable.pm 17 2006-02-12T08:00:01.814064Z mrodrigu $ | ||
| 2 | |||
| 3 | package Tree::XPathEngine::Variable; | ||
| 4 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | # This class does NOT contain 1 instance of a variable | ||
| 7 | # see the Tree::XPathEngine class for the instances | ||
| 8 | # This class simply holds the name of the var | ||
| 9 | |||
| 10 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 11 | 0 | my $class = shift; | |
| 12 | 0 | my ($pp, $name) = @_; | |
| 13 | 0 | bless { name => $name, path_parser => $pp }, $class; | |
| 14 | } | ||
| 15 | |||
| 16 | 0 | ▶ | sub as_string { |
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 17 | 0 | my $self = shift; | |
| 18 | 0 | '\$' . $self->{name}; | |
| 19 | } | ||
| 20 | |||
| 21 | 0 | ▶ | sub as_xml { |
|
Subroutine
as_xml: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 22 | 0 | my $self = shift; | |
| 23 | 0 | return "<Variable>" . $self->{name} . "</Variable>\n"; | |
| 24 | } | ||
| 25 | |||
| 26 | 0 | ▶ | sub xpath_get_value { |
|
Subroutine
xpath_get_value: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | 0 | my $self = shift; | |
| 28 | 0 | $self->{path_parser}->get_var($self->{name}); | |
| 29 | } | ||
| 30 | |||
| 31 | 0 | ▶ | sub xpath_set_value { |
|
Subroutine
xpath_set_value: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 32 | 0 | my $self = shift; | |
| 33 | 0 | my ($val) = @_; | |
| 34 | 0 | $self->{path_parser}->set_var($self->{name}, $val); | |
| 35 | } | ||
| 36 | |||
| 37 | 0 | ▶ | sub evaluate { |
|
Subroutine
evaluate: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 38 | 0 | my $self = shift; | |
| 39 | 0 | my $val = $self->xpath_get_value; | |
| 40 | 0 | return $val; | |
| 41 | } | ||
| 42 | |||
| 43 | 6 | 1; | |
| 44 | |||
| 45 | __END__ | ||