File Coverage

blib/lib/Lingua/YaTeA/Option.pm
Criterion Covered Total %
statement 18 22 81.8
branch 1 2 50.0
condition n/a
subroutine 5 6 83.3
pod 4 4 100.0
total 28 34 82.3


line stmt bran cond sub pod time code
1             package Lingua::YaTeA::Option;
2 5     5   30 use strict;
  5         9  
  5         123  
3 5     5   20 use warnings;
  5         7  
  5         1168  
4              
5             our $VERSION=$Lingua::YaTeA::VERSION;
6              
7             sub new
8             {
9 108     108 1 162 my ($class,$name,$value) = @_;
10 108         130 my $this = {};
11 108         128 bless ($this,$class);
12 108         167 $this->{NAME} = $name;
13 108         139 $this->{VALUE} = $value;
14 108         332 return $this;
15             }
16              
17             sub getName
18             {
19 0     0 1 0 my ($this) = @_;
20 0         0 return $this->{NAME};
21             }
22              
23              
24             sub getValue
25             {
26 783     783 1 1063 my ($this) = @_;
27 783         2553 return $this->{VALUE};
28             }
29              
30             sub update
31             {
32 4     4 1 13 my ($this,$new_value,$message_set,$display_language) = @_;
33 4         11 my $old_value = $this->getValue;
34 4         9 $this->{VALUE} = $new_value;
35 4 50       21 if(defined $message_set)
36             {
37 0           print STDERR "WARNING: " . $this->getName . ": " . $message_set->getMessage('OPTION_VALUE_UPDATE')->getContent($display_language) . "\"" . $new_value . "\" (";
38 0           print STDERR $message_set->getMessage('OLD_OPTION_VALUE')->getContent($display_language) . "\"". $old_value . "\")\n";
39             }
40             }
41              
42             1;
43              
44             __END__