Resume/Types.pm

filter: Statementstmt 87.3% 69 / 79 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 72.4% 21 / 29 Podpod n/a totaltotal 83.3% 90 / 108 CC 1 SCAR 1.0
CC
1
Cov
87%
__ANON__
2.0
__ANON__
2.0
__ANON__
1.3
CRAP 1.1
« Resume/Moose.pm ↑ Summary Resume/Types/Education.pm »
1 7 ▶use Moops;
Subroutine __ANON__: called CC=1 SCAR=0.0
2 7 ▶use strict;
Subroutine __ANON__: called CC=1 SCAR=0.0
3 7 ▶use warnings;
Subroutine __ANON__: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: Declares types
6 # PODNAME: Acme::Resume::Types
7 7 our $VERSION = '0.0109';
8 7  
9 7 ▶library Acme::Resume::Types
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 declares
12 Education,
13 Educations,
14 Job,
15 Jobs,
16 TimeMoment {
17  
18 7 class_type TimeMoment => { class => 'Time::Moment' };
19 7 class_type Education => { class => 'Acme::Resume::Types::Education' };
20 7 class_type Job => { class => 'Acme::Resume::Types::Job' };
21  
22 coerce Education,
23 from HashRef,
24 0 ▶ via {
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 0 'Acme::Resume::Types::Education'->new(%$_);
26 7 };
27  
28 coerce Job,
29 from HashRef,
30 0 ▶ via {
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 0 'Acme::Resume::Types::Job'->new(%$_);
32 7 };
33  
34 declare Educations,
35 as ArrayRef[Education],
36 0 ▶ message { sprintf "Those are not Education objects." };
Subroutine __ANON__: not called CC=1 SCAR=1.2
37  
38 coerce Educations,
39 from ArrayRef[HashRef],
40 0 ▶ via { [ map { 'Acme::Resume::Types::Education'->new($_) } @$_ ] };
Subroutine __ANON__: not called CC=1 SCAR=2.6
41  
42 coerce Educations,
43 from HashRef,
44 0 ▶ via { [ 'Acme::Resume::Types::Education'->new(%$_) ] };
Subroutine __ANON__: not called CC=1 SCAR=1.2
45  
46  
47 declare Jobs,
48 as ArrayRef[Job],
49 0 ▶ message { sprintf "Those are not Job objects." };
Subroutine __ANON__: not called CC=1 SCAR=1.2
50  
51 coerce Jobs,
52 from ArrayRef[HashRef],
53 0 ▶ via { [ map { 'Acme::Resume::Types::Job'->new($_) } @$_ ] };
Subroutine __ANON__: not called CC=1 SCAR=2.6
54  
55 coerce Jobs,
56 from HashRef,
57 0 ▶ via { [ 'Acme::Resume::Types::Job'->new(%$_) ] };
Subroutine __ANON__: not called CC=1 SCAR=1.2
58  
59  
60 coerce TimeMoment,
61 from Str,
62 10 ▶ via {
Subroutine __ANON__: called CC=1 SCAR=0.0
63 10 $_ =~ m{^(?<month>\w*) \s # full month name
64 (?<day>\d{1,2}), \s # day of month
65 (?<year>\d{4}) # year
66 }x;
67  
68 10 my %months = (January => 1, February => 2, March => 3, April => 4, May => 5, June => 6, July => 7, August => 8, September => 9, October => 10, November => 11, December => 12);
69  
70 'Time::Moment'->new(year => $+{'year'},
71 month => $months{ $+{'month'} },
72 10 day => $+{'day'},
73 );
74 7 };
75 }
76  
77 7 1;
78  
79 __END__
« Resume/Moose.pm ↑ Summary Resume/Types/Education.pm »