File Coverage

blib/lib/Form/Factory/Control/Value.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::Value;
2             $Form::Factory::Control::Value::VERSION = '0.022';
3 1     1   484 use Moose;
  1         2  
  1         6  
4              
5             with qw(
6             Form::Factory::Control
7             Form::Factory::Control::Role::HiddenValue
8             Form::Factory::Control::Role::Labeled
9             Form::Factory::Control::Role::PresetValue
10             Form::Factory::Control::Role::ScalarValue
11             );
12              
13             # ABSTRACT: A read-only value control
14              
15              
16             has '+value' => (
17             required => 1,
18             );
19              
20              
21             has is_visible => (
22             is => 'ro',
23             isa => 'Bool',
24             required => 1,
25             default => 0,
26             );
27              
28             __PACKAGE__->meta->make_immutable;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Form::Factory::Control::Value - A read-only value control
39              
40             =head1 VERSION
41              
42             version 0.022
43              
44             =head1 SYNOPSIS
45              
46             has_control preset_value => (
47             control => 'value',
48             options => {
49             label => 'Preset',
50             is_visible => 1,
51             value => 'Neo',
52             },
53             );
54              
55             =head1 DESCRIPTION
56              
57             A read-only value. These may be displayed in the form or just passed through the stash. They might be passed by form submission as well (depending on the interface, but this should be avoided).
58              
59             This control implements L<Form::Factory::Control>, L<Form::Factory::Control::Role::Labeled>, L<Form::Factory::Control::Role::ScalarValue>.
60              
61             =head1 ATTRIBUTES
62              
63             =head2 is_visible
64              
65             Set to true if the read-only value should be displayed.
66              
67             =head1 AUTHOR
68              
69             Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
70              
71             =head1 COPYRIGHT AND LICENSE
72              
73             This software is copyright (c) 2015 by Qubling Software LLC.
74              
75             This is free software; you can redistribute it and/or modify it under
76             the same terms as the Perl 5 programming language system itself.
77              
78             =cut