Resume/Types.pm

filter: Statementstmt 87.3% 69 / 79 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 65.2% 15 / 23 Podpod n/a totaltotal 82.3% 84 / 102 CC 1 SCAR 1.3
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 # PODNAME: Acme::Resume::Types
6 7 our $VERSION = '0.0102'; # VERSION
7 # ABSTRACT: Declares types
8 7  
9 7 ▶library Acme::Resume::Types
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 via {
25 0 ▶ 'Acme::Resume::Types::Education'->new(%$_);
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 7 };
27  
28 coerce Job,
29 from HashRef,
30 via {
31 0 ▶ 'Acme::Resume::Types::Job'->new(%$_);
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 7 };
33  
34 declare Educations,
35 as ArrayRef[Education],
36 7 ▶ 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 7 ▶ via { [ map { 'Acme::Resume::Types::Education'->new($_) } @$_ ] };
Subroutine __ANON__: not called CC=1 SCAR=2.6
41  
42 coerce Educations,
43 from HashRef,
44 7 ▶ 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 7 ▶ 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 7 ▶ via { [ map { 'Acme::Resume::Types::Job'->new($_) } @$_ ] };
Subroutine __ANON__: not called CC=1 SCAR=2.6
54  
55 coerce Jobs,
56 from HashRef,
57 7 ▶ via { [ 'Acme::Resume::Types::Job'->new(%$_) ] };
Subroutine __ANON__: not called CC=1 SCAR=1.2
58  
59  
60 coerce TimeMoment,
61 from Str,
62 via {
63 10 ▶ $_ =~ m{^(?<month>\w*) \s # full month name
Subroutine __ANON__: called CC=1 SCAR=0.0
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__
80  
81 =pod
82  
83 =encoding UTF-8
84  
85 =head1 NAME
86  
87 Acme::Resume::Types - Declares types
88  
89 =head1 VERSION
90  
91 Version 0.0102, released 2016-01-27.
92  
93 =head1 SOURCE
94  
95 L<https://github.com/Csson/p5-Acme-Resume>
96  
97 =head1 HOMEPAGE
98  
99 L<https://metacpan.org/release/Acme-Resume>
100  
101 =head1 AUTHOR
102  
103 Erik Carlsson <info@code301.com>
104  
105 =head1 COPYRIGHT AND LICENSE
106  
107 This software is copyright (c) 2016 by Erik Carlsson.
108  
109 This is free software; you can redistribute it and/or modify it under
110 the same terms as the Perl 5 programming language system itself.
111  
112 =cut
« Resume/Moose.pm ↑ Summary Resume/Types/Education.pm »