File Coverage

blib/lib/Data/HTML/Form/Select.pm
Criterion Covered Total %
statement 12 28 42.8
branch 0 8 0.0
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 42 38.1


line stmt bran cond sub pod time code
1              
2             use strict;
3 2     2   78178 use warnings;
  2         21  
  2         57  
4 2     2   10  
  2         4  
  2         83  
5             use Mo qw(build default is);
6 2     2   908 use Mo::utils qw(check_array_object check_bool check_number);
  2         1057  
  2         10  
7 2     2   5454  
  2         28648  
  2         35  
8             our $VERSION = 0.05;
9              
10             has autofocus => (
11             ro => 1,
12             );
13              
14             has css_class => (
15             is => 'ro',
16             );
17              
18             has disabled => (
19             is => 'ro',
20             );
21              
22             has form => (
23             ro => 1,
24             );
25              
26             has id => (
27             is => 'ro',
28             );
29              
30             has label => (
31             is => 'ro',
32             );
33              
34             has multiple => (
35             is => 'ro',
36             );
37              
38             has name => (
39             is => 'ro',
40             );
41              
42             has options => (
43             default => [],
44             is => 'ro',
45             );
46              
47             has required => (
48             is => 'ro',
49             );
50              
51             has size => (
52             is => 'ro',
53             );
54              
55             my $self = shift;
56              
57 0     0 0   # Check autofocus.
58             if (! defined $self->{'autofocus'}) {
59             $self->{'autofocus'} = 0;
60 0 0         }
61 0           check_bool($self, 'autofocus');
62              
63 0           # Check disabled.
64             if (! defined $self->{'disabled'}) {
65             $self->{'disabled'} = 0;
66 0 0         }
67 0           check_bool($self, 'disabled');
68              
69 0           # Check multiple.
70             if (! defined $self->{'multiple'}) {
71             $self->{'multiple'} = 0;
72 0 0         }
73 0           check_bool($self, 'multiple');
74              
75 0           # Check options.
76             check_array_object($self, 'options', 'Data::HTML::Form::Select::Option', 'Option');
77              
78 0           # Check required.
79             if (! defined $self->{'required'}) {
80             $self->{'required'} = 0;
81 0 0         }
82 0           check_bool($self, 'required');
83              
84 0           # Check size.
85             check_number($self, 'size');
86              
87 0           return;
88             }
89 0            
90             1;
91