Result/Moo.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 3 / 3 totaltotal 100% 35 / 35 CC 2 SCAR 2.0
CC
2
Cov
100%
new_false
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Result.pm ↑ Summary
1 package Data::Result::Moo;
2  
3 1 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Data::Result;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9  
10 =head1 NAME
11  
12 Data::Result::Moo - Data::Result Moo Role
13  
14 =head1 SYNOPSIS
15  
16 use Modern::Perl;
17 use Moo;
18 with('Data::Result::Moo);
19  
20 =head1 Description
21  
22 A simple Moo role wrapper for Data::Result
23  
24  
25 =head1 OO Methods
26  
27 =over 4
28  
29 =item * my $result->new_true($data,$extra|undef)
30  
31 Creates a new true Data::Result Object
32  
33 =item * my $result=$self->new_false($msg,$extra|undef)
34  
35 Creates a new false Data::Result Object
36  
37 =item * $class=$self->RESULT_CLASS;
38  
39 Returns the class being used to generate result object. Defaults to Data::Result;
40  
41 =cut
42  
43 2 ▶sub new_true {
Subroutine new_true: called CC=1 SCAR=0.0
Pod documented
44 2 my ($self,$data,$extra)=@_;
45 2 return $self->RESULT_CLASS->new_true($data,$extra);
46
47 }
48  
49 3 ▶sub new_false {
Subroutine new_false: called CC=2 SCAR=6.9
Pod documented
50 3 my ($self,$msg,$extra)=@_;
51 3 ▶ croak '$msg is a required argument' unless defined($msg);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $msg 1 2 3
52 2 return $self->RESULT_CLASS->new_false($msg,$extra);
53 }
54  
55 6 ▶sub RESULT_CLASS { 'Data::Result' }
Subroutine RESULT_CLASS: called CC=1 SCAR=0.0
Pod documented
56  
57 =back
58  
59 =head1 Author
60  
61 Mike Shipper <AKALINUX@CPAN.ORG>
62  
63 =cut
64  
65 1 1;
« Result.pm ↑ Summary