File Coverage

lib/HTML/FormWidgets/Note.pm
Criterion Covered Total %
statement 20 20 100.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 5 5 100.0
pod 2 2 100.0
total 29 32 90.6


line stmt bran cond sub pod time code
1             package HTML::FormWidgets::Note;
2              
3 1     1   717 use strict;
  1         1  
  1         26  
4 1     1   5 use warnings;
  1         2  
  1         27  
5 1     1   5 use parent 'HTML::FormWidgets';
  1         2  
  1         6  
6              
7             __PACKAGE__->mk_accessors( qw( width ) );
8              
9             sub init {
10 1     1 1 3    my ($self, $args) = @_;
11              
12 1         6    $self->class ( q(note) );
13 1         9    $self->container( 0 );
14 1         8    $self->sep ( q() );
15 1         6    $self->width ( undef );
16 1         8    return;
17             }
18              
19             sub render_field {
20 1     1 1 2    my ($self, $args) = @_;
21              
22 1         4    $args = { class => $self->class, id => $self->id };
23 1 50       10    $self->width and $args->{style} .= ' width: '.$self->width.q(;);
24              
25 1   33     7    (my $text = $self->text || $self->loc( $self->name )) =~ s{ \A \n }{}msx;
26              
27 1         8    return $self->hacc->span( $args, $text );
28             }
29              
30             1;
31              
32             # Local Variables:
33             # mode: perl
34             # tab-width: 3
35             # End:
36