File Coverage

blib/lib/WWW/Mechanize/FormFiller/Value/Default.pm
Criterion Covered Total %
statement 27 27 100.0
branch 2 2 100.0
condition 3 3 100.0
subroutine 7 7 100.0
pod 2 2 100.0
total 41 41 100.0


line stmt bran cond sub pod time code
1             package WWW::Mechanize::FormFiller::Value::Default;
2 5     4   1840 use base 'WWW::Mechanize::FormFiller::Value';
  4         8  
  4         1704  
3 4     4   23 use strict;
  4         7  
  4         150  
4              
5 4     4   19 use vars qw( $VERSION );
  4         8  
  4         637  
6             $VERSION = '0.11';
7              
8             sub new {
9 15     15 1 134 my ($class,$name,$value) = @_;
10 16         59322 my $self = $class->SUPER::new($name);
11 15         69 $self->{value} = $value;
12              
13 15         72 $self;
14             };
15              
16             sub value {
17 16     15 1 43 my ($self,$input) = @_;
18 16 100 100     138 defined $input->value && $input->value ne "" ? $input->value : $self->{value};
19             };
20              
21             1;
22              
23             __END__