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   1950 use base 'WWW::Mechanize::FormFiller::Value';
  4         6  
  4         992  
3 4     4   24 use strict;
  4         8  
  4         81  
4              
5 4     4   17 use vars qw( $VERSION );
  4         7  
  4         517  
6             $VERSION = '0.13';
7              
8             sub new {
9 15     15 1 260 my ($class,$name,$value) = @_;
10 16         27141 my $self = $class->SUPER::new($name);
11 15         64 $self->{value} = $value;
12              
13 15         53 $self;
14             };
15              
16             sub value {
17 16     15 1 48 my ($self,$input) = @_;
18 16 100 100     107 defined $input->value && $input->value ne "" ? $input->value : $self->{value};
19             };
20              
21             1;
22              
23             __END__