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

filter: Statementstmt 100% 33 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 100% 42 / 42 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Net/API/RPX/Exception/Service.pm ↑ Summary
1 4 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Net::API::RPX::Exception::Usage;
6  
7 # ABSTRACT: For when the interface is used wrongly
8  
9 4 our $VERSION = '1.000000';
10  
11 4 our $AUTHORITY = 'cpan:KONOBI'; # AUTHORITY
12  
13 4 ▶use Moose qw( has extends around );
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 4 extends 'Net::API::RPX::Exception';
17  
18 4 has 'required_parameter' => ( isa => 'Str', is => 'rw', required => 1 );
19 4 has 'method_name' => ( isa => 'Str', is => 'rw', required => 1 );
20 4 has 'signature' => ( isa => 'Str', is => 'rw', required => 1 );
21 4 has 'package' => ( isa => 'Str', is => 'rw', required => 1 );
22  
23 sub _signature_string {
24 12 ▶ my ($self) = @_;
Subroutine _signature_string: called CC=1 SCAR=0.0
25 12 return $self->method_name . '(' . $self->signature . ')';
26 }
27  
28 sub _explanation {
29 12 ▶ my ($self) = @_;
Subroutine _explanation: called CC=1 SCAR=0.0
30 12 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 12 ▶ my ( $orig, $self, @args ) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
37 12 return $self->$orig(@args) . qq{\n} . $self->_explanation;
38 4 };
39  
40 4 __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
41  
42 4 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
43  
44 4 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
« lib/Net/API/RPX/Exception/Service.pm ↑ Summary