| line | stmt | bran | cond | sub | pod | time | code | 
| 1 | 1 |  |  | 1 |  | 18 | use 5.14.0; | 
|  | 1 |  |  |  |  | 4 |  | 
| 2 | 1 |  |  | 1 |  | 6 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 35 |  | 
| 3 | 1 |  |  | 1 |  | 6 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 90 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | package Acme::Resume::Moose; | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | # ABSTRACT: Imports methods and adds attributes | 
| 8 |  |  |  |  |  |  | our $VERSION = '0.0105'; | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 1 |  |  | 1 |  | 589 | use Moose::Exporter; | 
|  | 1 |  |  |  |  | 168700 |  | 
|  | 1 |  |  |  |  | 10 |  | 
| 11 | 1 |  |  | 1 |  | 730 | use Acme::Resume::Types::Job; | 
|  | 1 |  |  |  |  | 4 |  | 
|  | 1 |  |  |  |  | 50 |  | 
| 12 | 1 |  |  | 1 |  | 535 | use Acme::Resume::Types::Education; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 56 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 | 1 |  |  | 1 |  | 10 | use Types::Standard -types; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 6 |  | 
| 15 | 1 |  |  | 1 |  | 5345 | use Acme::Resume::Types -types; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 6 |  | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | Moose::Exporter->setup_import_methods(with_meta => [qw/name email phone address education job/]); | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | sub name { | 
| 20 | 1 |  |  | 1 | 0 | 45684 | my $meta = shift; | 
| 21 | 1 |  |  |  |  | 6 | $meta->add_attribute(name => ( | 
| 22 |  |  |  |  |  |  | is => 'ro', | 
| 23 |  |  |  |  |  |  | isa => Str, | 
| 24 |  |  |  |  |  |  | default => shift, | 
| 25 |  |  |  |  |  |  | )); | 
| 26 |  |  |  |  |  |  | } | 
| 27 |  |  |  |  |  |  | sub email { | 
| 28 | 1 |  |  | 1 | 0 | 3089 | my $meta = shift; | 
| 29 | 1 |  |  |  |  | 5 | $meta->add_attribute(email => ( | 
| 30 |  |  |  |  |  |  | is => 'ro', | 
| 31 |  |  |  |  |  |  | isa => Str, | 
| 32 |  |  |  |  |  |  | default => shift, | 
| 33 |  |  |  |  |  |  | )); | 
| 34 |  |  |  |  |  |  | } | 
| 35 |  |  |  |  |  |  | sub phone { | 
| 36 | 1 |  |  | 1 | 0 | 263726 | my $meta = shift; | 
| 37 | 1 |  |  |  |  | 7 | $meta->add_attribute(phone => ( | 
| 38 |  |  |  |  |  |  | is => 'ro', | 
| 39 |  |  |  |  |  |  | isa => Str, | 
| 40 |  |  |  |  |  |  | default => shift, | 
| 41 |  |  |  |  |  |  | )); | 
| 42 |  |  |  |  |  |  | } | 
| 43 |  |  |  |  |  |  | sub address { | 
| 44 | 1 |  |  | 1 | 0 | 2518 | my $meta = shift; | 
| 45 | 1 |  |  |  |  | 4 | my $address = shift; | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | $meta->add_attribute(address => ( | 
| 48 |  |  |  |  |  |  | is => 'ro', | 
| 49 |  |  |  |  |  |  | isa => ArrayRef[Str], | 
| 50 | 1 |  |  | 1 |  | 250 | default => sub { $address }, | 
| 51 | 1 |  |  |  |  | 5 | traits => ['Array'], | 
| 52 |  |  |  |  |  |  | handles => { | 
| 53 |  |  |  |  |  |  | add_address => 'push', | 
| 54 |  |  |  |  |  |  | full_address => 'elements', | 
| 55 |  |  |  |  |  |  | has_address => 'count', | 
| 56 |  |  |  |  |  |  | get_address => 'get', | 
| 57 |  |  |  |  |  |  | join_address => 'join', | 
| 58 |  |  |  |  |  |  | }, | 
| 59 |  |  |  |  |  |  | )); | 
| 60 |  |  |  |  |  |  | } | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | sub education { | 
| 63 | 3 |  |  | 3 | 0 | 39465 | my $meta = shift; | 
| 64 | 3 |  |  |  |  | 8 | my $education = shift; | 
| 65 |  |  |  |  |  |  |  | 
| 66 | 3 |  |  |  |  | 6 | my $current_educations = []; | 
| 67 |  |  |  |  |  |  |  | 
| 68 | 3 | 100 |  |  |  | 12 | if($meta->has_attribute('educations')) { | 
| 69 | 2 |  |  |  |  | 22 | push @$current_educations => @{ $meta->get_attribute('educations')->default->() }; | 
|  | 2 |  |  |  |  | 24 |  | 
| 70 | 2 |  |  |  |  | 12 | $meta->remove_attribute('educations'); | 
| 71 |  |  |  |  |  |  | } | 
| 72 |  |  |  |  |  |  |  | 
| 73 | 3 |  |  |  |  | 1353 | push @{ $current_educations } => Acme::Resume::Types::Education->new(%{ $education }); | 
|  | 3 |  |  |  |  | 15 |  | 
|  | 3 |  |  |  |  | 30 |  | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | $meta->add_attribute(educations => ( | 
| 76 |  |  |  |  |  |  | is => 'ro', | 
| 77 |  |  |  |  |  |  | isa => Educations, | 
| 78 |  |  |  |  |  |  | traits => ['Array'], | 
| 79 | 3 |  |  | 3 |  | 88 | default => sub { $current_educations }, | 
| 80 | 3 |  |  |  |  | 20 | coerce => 1, | 
| 81 |  |  |  |  |  |  | handles => { | 
| 82 |  |  |  |  |  |  | add_education => 'push', | 
| 83 |  |  |  |  |  |  | all_educations => 'elements', | 
| 84 |  |  |  |  |  |  | has_education => 'count', | 
| 85 |  |  |  |  |  |  | get_education => 'get', | 
| 86 |  |  |  |  |  |  | }, | 
| 87 |  |  |  |  |  |  | )); | 
| 88 |  |  |  |  |  |  | } | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  | sub job { | 
| 91 | 2 |  |  | 2 | 0 | 34675 | my $meta = shift; | 
| 92 | 2 |  |  |  |  | 6 | my $job = shift; | 
| 93 |  |  |  |  |  |  |  | 
| 94 | 2 |  |  |  |  | 4 | my $current_jobs = []; | 
| 95 |  |  |  |  |  |  |  | 
| 96 | 2 | 100 |  |  |  | 8 | if($meta->has_attribute('jobs')) { | 
| 97 | 1 |  |  |  |  | 12 | push @$current_jobs => @{ $meta->get_attribute('jobs')->default->() }; | 
|  | 1 |  |  |  |  | 5 |  | 
| 98 | 1 |  |  |  |  | 4 | $meta->remove_attribute('jobs'); | 
| 99 |  |  |  |  |  |  | } | 
| 100 |  |  |  |  |  |  |  | 
| 101 | 2 |  |  |  |  | 666 | push @{ $current_jobs } => Acme::Resume::Types::Job->new(%{ $job }); | 
|  | 2 |  |  |  |  | 13 |  | 
|  | 2 |  |  |  |  | 20 |  | 
| 102 |  |  |  |  |  |  |  | 
| 103 |  |  |  |  |  |  | $meta->add_attribute(jobs => ( | 
| 104 |  |  |  |  |  |  | is => 'ro', | 
| 105 |  |  |  |  |  |  | isa => Jobs, | 
| 106 |  |  |  |  |  |  | traits => ['Array'], | 
| 107 | 2 |  |  | 2 |  | 75 | default => sub { $current_jobs }, | 
| 108 | 2 |  |  |  |  | 11 | coerce => 1, | 
| 109 |  |  |  |  |  |  | handles => { | 
| 110 |  |  |  |  |  |  | add_job => 'push', | 
| 111 |  |  |  |  |  |  | all_jobs => 'elements', | 
| 112 |  |  |  |  |  |  | has_job_history => 'count', | 
| 113 |  |  |  |  |  |  | get_job => 'get', | 
| 114 |  |  |  |  |  |  | }, | 
| 115 |  |  |  |  |  |  | )); | 
| 116 |  |  |  |  |  |  | } | 
| 117 |  |  |  |  |  |  |  | 
| 118 |  |  |  |  |  |  | 1; | 
| 119 |  |  |  |  |  |  |  | 
| 120 |  |  |  |  |  |  | __END__ | 
| 121 |  |  |  |  |  |  |  | 
| 122 |  |  |  |  |  |  | =pod | 
| 123 |  |  |  |  |  |  |  | 
| 124 |  |  |  |  |  |  | =encoding UTF-8 | 
| 125 |  |  |  |  |  |  |  | 
| 126 |  |  |  |  |  |  | =head1 NAME | 
| 127 |  |  |  |  |  |  |  | 
| 128 |  |  |  |  |  |  | Acme::Resume::Moose - Imports methods and adds attributes | 
| 129 |  |  |  |  |  |  |  | 
| 130 |  |  |  |  |  |  | =head1 VERSION | 
| 131 |  |  |  |  |  |  |  | 
| 132 |  |  |  |  |  |  | Version 0.0105, released 2021-09-29. | 
| 133 |  |  |  |  |  |  |  | 
| 134 |  |  |  |  |  |  | =head1 SOURCE | 
| 135 |  |  |  |  |  |  |  | 
| 136 |  |  |  |  |  |  | L<https://github.com/Csson/p5-Acme-Resume> | 
| 137 |  |  |  |  |  |  |  | 
| 138 |  |  |  |  |  |  | =head1 HOMEPAGE | 
| 139 |  |  |  |  |  |  |  | 
| 140 |  |  |  |  |  |  | L<https://metacpan.org/release/Acme-Resume> | 
| 141 |  |  |  |  |  |  |  | 
| 142 |  |  |  |  |  |  | =head1 AUTHOR | 
| 143 |  |  |  |  |  |  |  | 
| 144 |  |  |  |  |  |  | Erik Carlsson <info@code301.com> | 
| 145 |  |  |  |  |  |  |  | 
| 146 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 147 |  |  |  |  |  |  |  | 
| 148 |  |  |  |  |  |  | This software is copyright (c) 2021 by Erik Carlsson. | 
| 149 |  |  |  |  |  |  |  | 
| 150 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 151 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 152 |  |  |  |  |  |  |  | 
| 153 |  |  |  |  |  |  | =cut |