File Coverage

lib/HTML/FormWidgets/Textarea.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 4 50.0
condition 2 5 40.0
subroutine 5 5 100.0
pod 2 2 100.0
total 31 36 86.1


line stmt bran cond sub pod time code
1             package HTML::FormWidgets::Textarea;
2              
3 1     1   673 use strict;
  1         2  
  1         63  
4 1     1   6 use warnings;
  1         1  
  1         28  
5 1     1   4 use parent 'HTML::FormWidgets';
  1         2  
  1         7  
6              
7             __PACKAGE__->mk_accessors( qw( cols config rows ) );
8              
9             sub init {
10 1     1 1 2    my ($self, $args) = @_;
11              
12 1         3    $self->cols ( 60 );
13 1         6    $self->config( undef );
14 1         6    $self->rows ( 1 );
15 1         5    return;
16             }
17              
18             sub render_field {
19 1     1 1 2    my ($self, $args) = @_;
20              
21 1 50 33     4    $self->id and $self->config
22                   and $self->add_literal_js( 'inputs', $self->id, $self->config );
23              
24 1 50 50     12    $args->{class} .= ($args->{class} ? q( ): q()).($self->class || q(ifield));
25              
26 1         10    $args->{cols } = $self->cols; $args->{rows} = $self->rows;
  1         6  
27              
28 1         6    return $self->hacc->textarea( $args );
29             }
30              
31             1;
32              
33             # Local Variables:
34             # mode: perl
35             # tab-width: 3
36             # End:
37