blib/lib/Net/API/RPX/Exception/Usage.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 44 SCAR 6.9
CC
1
Cov
0%
_signature_string
2.0
_explanation
2.0
BEGIN
2.0
CRAP 2.0
1 use 5.006;
2 use strict;
3 use warnings;
4  
5 package Net::API::RPX::Exception::Usage;
6  
7 # ABSTRACT: For when the interface is used wrongly
8  
9 our $VERSION = '1.000000';
10  
11 our $AUTHORITY = 'cpan:KONOBI'; # AUTHORITY
12  
13 use Moose qw( has extends around );
14 use namespace::autoclean;
15  
16 extends 'Net::API::RPX::Exception';
17  
18 has 'required_parameter' => ( isa => 'Str', is => 'rw', required => 1 );
19 has 'method_name' => ( isa => 'Str', is => 'rw', required => 1 );
20 has 'signature' => ( isa => 'Str', is => 'rw', required => 1 );
21 has 'package' => ( isa => 'Str', is => 'rw', required => 1 );
22  
23 sub _signature_string {
24 my ($self) = @_;
25 return $self->method_name . '(' . $self->signature . ')';
26 }
27  
28 sub _explanation {
29 my ($self) = @_;
30 return sprintf q{Method %s on package %s expects the parameter "%s"} . qq{\n\n} . qq{\tUsage:\t%s\n}, $self->method_name,
31 $self->package,
32 $self->required_parameter, $self->_signature_string;
33 }
34  
35 around message => sub {
36 my ( $orig, $self, @args ) = @_;
37 return $self->$orig(@args) . qq{\n} . $self->_explanation;
38 };
39  
40 __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
41  
42 no Moose;
43  
44 1;
45  
46 __END__
47  
48 =pod
49  
50 =encoding UTF-8
51  
52 =head1 NAME
53  
54 Net::API::RPX::Exception::Usage - For when the interface is used wrongly
55  
56 =head1 VERSION
57  
58 version 1.000000
59  
60 =head1 AUTHORS
61  
62 =over 4
63  
64 =item *
65  
66 Scott McWhirter <konobi@cpan.org>
67  
68 =item *
69  
70 Kent Fredric <kentnl@cpan.org>
71  
72 =back
73  
74 =head1 COPYRIGHT AND LICENSE
75  
76 This software is Copyright (c) 2015 by Cloudtone Studios.
77  
78 This is free software, licensed under:
79  
80 The (three-clause) BSD License
81  
82 =cut