File Coverage

blib/lib/Perl/ToPerl6/Exception/Configuration/Option.pm
Criterion Covered Total %
statement 14 19 73.6
branch n/a
condition n/a
subroutine 5 8 62.5
pod 3 3 100.0
total 22 30 73.3


line stmt bran cond sub pod time code
1             package Perl::ToPerl6::Exception::Configuration::Option;
2              
3 1     1   656 use 5.006001;
  1         3  
4 1     1   4 use strict;
  1         2  
  1         17  
5 1     1   4 use warnings;
  1         2  
  1         21  
6              
7             #-----------------------------------------------------------------------------
8              
9 1     1   518 use Perl::ToPerl6::Exception::Fatal::Internal;
  1         3  
  1         53  
10              
11             use Exception::Class ( # this must come after "use P::C::Exception::*"
12 1         6 'Perl::ToPerl6::Exception::Configuration::Option' => {
13             isa => 'Perl::ToPerl6::Exception::Configuration',
14             description => 'A problem with an option in the Perl::ToPerl6 configuration, whether from a file or a command line or some other source.',
15             fields => [ qw{ option_name option_value message_suffix } ],
16             },
17 1     1   5 );
  1         1  
18              
19             #-----------------------------------------------------------------------------
20              
21             sub message {
22 0     0 1   my $self = shift;
23              
24 0           return $self->full_message();
25             }
26              
27             #-----------------------------------------------------------------------------
28              
29             sub error {
30 0     0 1   my $self = shift;
31              
32 0           return $self->full_message();
33             }
34              
35             #-----------------------------------------------------------------------------
36              
37             sub full_message {
38 0     0 1   Perl::ToPerl6::Exception::Fatal::Internal->throw(
39             'Subclass failed to override abstract method.'
40             );
41             }
42             ## use mogrify
43              
44              
45             1;
46              
47             __END__
48              
49             #-----------------------------------------------------------------------------
50              
51             =pod
52              
53             =for stopwords
54              
55             =head1 NAME
56              
57             Perl::ToPerl6::Exception::Configuration::Option - A problem with an option in the L<Perl::ToPerl6|Perl::ToPerl6> configuration.
58              
59             =head1 DESCRIPTION
60              
61             A representation of a problem found with an option in the
62             configuration of L<Perl::ToPerl6|Perl::ToPerl6>, whether from a
63             F<.perlmogrifyrc>, another profile file, or command line.
64              
65             This is an abstract class. It should never be instantiated.
66              
67              
68             =head1 INTERFACE SUPPORT
69              
70             This is considered to be a public class. Any changes to its interface
71             will go through a deprecation cycle.
72              
73              
74             =head1 METHODS
75              
76             =over
77              
78             =item C<option_name()>
79              
80             The name of the option that was found to be in error.
81              
82              
83             =item C<option_value()>
84              
85             The value of the option that was found to be in error.
86              
87              
88             =item C<message_suffix()>
89              
90             Any text that should be applied to end of the standard message for
91             this kind of exception.
92              
93              
94             =item C<message()>
95              
96             =item C<error()>
97              
98             Overridden to call C<full_message()>. I.e. any message string in the
99             superclass is ignored.
100              
101              
102             =item C<full_message()>
103              
104             Overridden to turn it into an abstract method to force subclasses to
105             implement it.
106              
107              
108             =back
109              
110              
111             =head1 SEE ALSO
112              
113             L<Perl::ToPerl6::Exception::Configuration::Option::Global|Perl::ToPerl6::Exception::Configuration::Option::Global>
114             L<Perl::ToPerl6::Exception::Configuration::Option::Transformer|Perl::ToPerl6::Exception::Configuration::Option::Transformer>
115              
116              
117             =head1 AUTHOR
118              
119             Elliot Shank <perl@galumph.com>
120              
121             =head1 COPYRIGHT
122              
123             Copyright (c) 2007-2011 Elliot Shank.
124              
125             This program is free software; you can redistribute it and/or modify
126             it under the same terms as Perl itself. The full text of this license
127             can be found in the LICENSE file included with this module.
128              
129             =cut
130              
131             # Local Variables:
132             # mode: cperl
133             # cperl-indent-level: 4
134             # fill-column: 78
135             # indent-tabs-mode: nil
136             # c-indentation-style: bsd
137             # End:
138             # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :