File Coverage

blib/lib/Form/Factory/Control/SelectOne.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Form::Factory::Control::SelectOne;
2             $Form::Factory::Control::SelectOne::VERSION = '0.022';
3 1     1   617 use Moose;
  1         2  
  1         6  
4              
5             with qw(
6             Form::Factory::Control
7             Form::Factory::Control::Role::AvailableChoices
8             Form::Factory::Control::Role::Labeled
9             Form::Factory::Control::Role::ScalarValue
10             );
11              
12             # ABSTRACT: A control for selecting a single item
13              
14              
15             has '+value' => (
16             isa => 'Str',
17             );
18              
19             has '+default_value' => (
20             isa => 'Str',
21             );
22              
23             __PACKAGE__->meta->make_immutable;
24              
25             __END__
26              
27             =pod
28              
29             =encoding UTF-8
30              
31             =head1 NAME
32              
33             Form::Factory::Control::SelectOne - A control for selecting a single item
34              
35             =head1 VERSION
36              
37             version 0.022
38              
39             =head1 SYNOPSIS
40              
41             has_control popup_menu => (
42             control => 'select_one',
43             options => {
44             available_choices => [
45             Form::Factory::Control::Choice->new('one'),
46             Form::Factory::Control::Choice->new('two'),
47             Form::Factory::Control::Choice->new('three'),
48             ],
49             default_value => 'two',
50             },
51             );
52              
53             =head1 DESCRIPTION
54              
55             A select control that allows a single selection. A list of radio buttons or a drop-down box would be appropriate.
56              
57             =head1 AUTHOR
58              
59             Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2015 by Qubling Software LLC.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut