File Coverage

blib/lib/Data/MuForm/Field/Boolean.pm
Criterion Covered Total %
statement 6 6 100.0
branch 2 2 100.0
condition n/a
subroutine 2 2 100.0
pod 1 1 100.0
total 11 11 100.0


line stmt bran cond sub pod time code
1             package Data::MuForm::Field::Boolean;
2             # ABSTRACT: a true or false field
3              
4 4     4   3113 use Moo;
  4         8181  
  4         26  
5             extends 'Data::MuForm::Field::Checkbox';
6             our $VERSION = '0.03';
7              
8              
9             sub value {
10 57     57 1 821 my $self = shift;
11              
12 57         134 my $v = $self->next::method(@_);
13              
14 57 100       570 return $v ? 1 : 0;
15             }
16              
17             1;
18              
19             __END__
20              
21             =pod
22              
23             =encoding UTF-8
24              
25             =head1 NAME
26              
27             Data::MuForm::Field::Boolean - a true or false field
28              
29             =head1 VERSION
30              
31             version 0.04
32              
33             =head1 DESCRIPTION
34              
35             This field returns 1 if true, 0 if false. The widget type is 'Checkbox'.
36             Similar to Checkbox, except only returns values of 1 or 0.
37              
38             =head1 AUTHOR
39              
40             Gerda Shank
41              
42             =head1 COPYRIGHT AND LICENSE
43              
44             This software is copyright (c) 2017 by Gerda Shank.
45              
46             This is free software; you can redistribute it and/or modify it under
47             the same terms as the Perl 5 programming language system itself.
48              
49             =cut