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   941 use base 'WWW::Mechanize::FormFiller::Value';
  4         5  
  4         825  
3 4     4   14 use strict;
  4         3  
  4         74  
4              
5 4     4   12 use vars qw( $VERSION );
  4         3  
  4         413  
6             $VERSION = '0.12';
7              
8             sub new {
9 15     15 1 95 my ($class,$name,$value) = @_;
10 16         15275 my $self = $class->SUPER::new($name);
11 15         41 $self->{value} = $value;
12              
13 15         38 $self;
14             };
15              
16             sub value {
17 16     15 1 21 my ($self,$input) = @_;
18 16 100 100     93 defined $input->value && $input->value ne "" ? $input->value : $self->{value};
19             };
20              
21             1;
22              
23             __END__