File Coverage

blib/lib/Spark/Form/Field/Role/Printable.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 Spark::Form::Field::Role::Printable;
2             our $VERSION = '0.2102';
3              
4              
5             # ABSTRACT: Printability for form fields
6              
7 14     14   7444 use Moose::Role;
  14         49  
  14         91  
8              
9             has label => (
10             isa => 'Str',
11             is => 'rw',
12             required => 0,
13             );
14              
15             1;
16              
17              
18              
19             =pod
20              
21             =head1 NAME
22              
23             Spark::Form::Field::Role::Printable - Printability for form fields
24              
25             =head1 VERSION
26              
27             version 0.2102
28              
29             =head1 DESCRIPTION
30              
31             A fairly free-form module, this is mostly used for checking that it's printable at all.
32             You probably want one of the roles under this hierarchy, but not just this one.
33              
34             =head1 SYNOPSIS
35              
36             package MyApp::Field::CustomText;
37             use Moose;
38             extends 'Spark::Form::Field';
39             with 'Spark::Form::Field::Role::Printable';
40              
41             sub to_string {
42             my $self = shift;
43             sprintf("%s: %s",$self->label, $self->value);
44             }
45              
46             =head1 VARS
47              
48             =head2 label :: Str [Optional]
49              
50             A label that will be printed next to said field in the printed out version
51              
52             =head1 SEE ALSO
53              
54             =over 4
55              
56             =item L<Spark::Form::Field::Printable::HTML> - Role for being printable under HTML4
57              
58             =item L<Spark::Form::Field::Printable::XHTML> - Role for being printable under XHTML1
59              
60             =back
61              
62              
63              
64             =head1 AUTHOR
65              
66             James Laver L<http://jameslaver.com>
67              
68             =head1 COPYRIGHT AND LICENSE
69              
70             This software is copyright (c) 2009 by James Laver C<< <sprintf qw(%s@%s.%s cpan jameslaver com)> >>.
71              
72             This is free software; you can redistribute it and/or modify it under
73             the same terms as the Perl 5 programming language system itself.
74              
75             =cut
76              
77              
78              
79             __END__
80