File Coverage

blib/lib/Data/MuForm/Field/Textarea.pm
Criterion Covered Total %
statement 12 12 100.0
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod 0 2 0.0
total 18 22 81.8


line stmt bran cond sub pod time code
1             package Data::MuForm::Field::Textarea;
2             # ABSTRACT: textarea input
3              
4 4     4   2600 use Moo;
  4         8109  
  4         19  
5             extends 'Data::MuForm::Field::Text';
6 4     4   2164 use Types::Standard -types;
  4         45374  
  4         39  
7              
8 2     2 0 42 sub build_form_element { 'textarea' }
9              
10             has 'cols' => ( is => 'rw', default => 40 );
11             has 'rows' => ( is => 'rw', default => 5 );
12              
13             sub base_render_args {
14 3     3 0 50 my $self = shift;
15 3         11 my $args = $self->next::method(@_);
16 3 50       21 $args->{element_attr}->{cols} = $self->cols if $self->cols;
17 3 50       16 $args->{element_attr}->{rows} = $self->rows if $self->rows;
18 3         8 return $args;
19             }
20              
21              
22              
23             1;
24              
25             __END__
26              
27             =pod
28              
29             =encoding UTF-8
30              
31             =head1 NAME
32              
33             Data::MuForm::Field::Textarea - textarea input
34              
35             =head1 VERSION
36              
37             version 0.04
38              
39             =head1 Summary
40              
41             For HTML textarea
42              
43             =head1 AUTHOR
44              
45             Gerda Shank
46              
47             =head1 COPYRIGHT AND LICENSE
48              
49             This software is copyright (c) 2017 by Gerda Shank.
50              
51             This is free software; you can redistribute it and/or modify it under
52             the same terms as the Perl 5 programming language system itself.
53              
54             =cut