File Coverage

blib/lib/Perl/ToPerl6/TransformerParameter/Behavior.pm
Criterion Covered Total %
statement 13 17 76.4
branch n/a
condition n/a
subroutine 5 7 71.4
pod 2 3 66.6
total 20 27 74.0


line stmt bran cond sub pod time code
1             package Perl::ToPerl6::TransformerParameter::Behavior;
2              
3 23     23   365 use 5.006001;
  23         65  
4 23     23   99 use strict;
  23         37  
  23         444  
5 23     23   92 use warnings;
  23         31  
  23         624  
6              
7 23     23   100 use Perl::ToPerl6::Utils qw{ :characters };
  23         30  
  23         1477  
8              
9             our $VERSION = '0.03';
10              
11             #-----------------------------------------------------------------------------
12              
13             sub new {
14 115     115 0 118 my $class = shift;
15              
16 115         611 return bless {}, $class;
17             }
18              
19             #-----------------------------------------------------------------------------
20              
21             sub initialize_parameter {
22 0     0 1   my ($self, $parameter, $specification) = @_;
23              
24 0           return;
25             }
26              
27             #-----------------------------------------------------------------------------
28              
29             sub generate_parameter_description {
30 0     0 1   my ($self, $parameter) = @_;
31              
32 0           return $parameter->_get_description_with_trailing_period();
33             }
34              
35             #-----------------------------------------------------------------------------
36              
37             1;
38              
39             __END__
40              
41             #-----------------------------------------------------------------------------
42              
43             =pod
44              
45             =for stopwords
46              
47             =head1 NAME
48              
49             Perl::ToPerl6::TransformerParameter::Behavior - Default type-specific actions for a parameter.
50              
51              
52             =head1 DESCRIPTION
53              
54             Provides a standard set of functionality for a
55             L<Perl::ToPerl6::TransformerParameter|Perl::ToPerl6::TransformerParameter> so that
56             the developer of a transformer does not have to provide it her/himself.
57             The developer can override most of the functionality in the
58             subclasses; these are just defaults.
59              
60             All subclasses have singleton instances held onto by
61             L<Perl::ToPerl6::TransformerParameter|Perl::ToPerl6::TransformerParameter>.
62              
63              
64             =head1 INTERFACE SUPPORT
65              
66             This is considered to be a non-public class. Its interface is subject
67             to change without notice.
68              
69              
70             =head1 METHODS
71              
72             =over
73              
74             =item C<initialize_parameter( $parameter, $specification )>
75              
76             Plug in the functionality this behavior provides into the parameter,
77             based upon the configuration provided by the specification. The
78             configuration items looked for depends upon the specific behavior
79             subclass.
80              
81             =item C<generate_parameter_description( $parameter )>
82              
83             Create a description of the parameter, based upon the description on
84             the parameter itself, but enhancing it with information from this
85             behavior.
86              
87             Note that this may return C<undef> if the parameter itself doesn't
88             have a description. Also, the returned value may include multiple
89             lines.
90              
91             =back
92              
93              
94             =head1 AUTHOR
95              
96             Elliot Shank <perl@galumph.com>
97              
98             =head1 COPYRIGHT
99              
100             Copyright (c) 2006-2011 Elliot Shank.
101              
102             This program is free software; you can redistribute it and/or modify
103             it under the same terms as Perl itself. The full text of this license
104             can be found in the LICENSE file included with this module.
105              
106             =cut
107              
108             # Local Variables:
109             # mode: cperl
110             # cperl-indent-level: 4
111             # fill-column: 78
112             # indent-tabs-mode: nil
113             # c-indentation-style: bsd
114             # End:
115             # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :