| 1 | package WWW::USF::Directory::Entry; | ||
| 2 | |||
| 3 | 2 | ▶ | use 5.008001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | ▶ | use warnings 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | ########################################################################### | ||
| 8 | # METADATA | ||
| 9 | 2 | our $AUTHORITY = 'cpan:DOUGDUDE'; | |
| 10 | 2 | our $VERSION = '0.003001'; | |
| 11 | |||
| 12 | ########################################################################### | ||
| 13 | # MOOSE | ||
| 14 | 2 | ▶ | use Moose 0.89; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 2 | ▶ | use MooseX::StrictConstructor 0.08; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | ########################################################################### | ||
| 18 | # MOOSE TYPES | ||
| 19 | 2 | ▶ | use MooseX::Types::Common::String qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | NonEmptySimpleStr | ||
| 21 | 2 | ); | |
| 22 | 2 | ▶ | use MooseX::Types::Email qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | EmailAddress | ||
| 24 | 2 | ); | |
| 25 | |||
| 26 | ########################################################################### | ||
| 27 | # ALL IMPORTS BEFORE THIS WILL BE ERASED | ||
| 28 | 2 | ▶ | use namespace::clean 0.04 -except => [qw(meta)]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | |||
| 30 | ########################################################################### | ||
| 31 | # ATTRIBUTES | ||
| 32 | has 'affiliations' => ( | ||
| 33 | is => 'ro', | ||
| 34 | isa => 'ArrayRef[WWW::USF::Directory::Entry::Affiliation]', | ||
| 35 | |||
| 36 | 0 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 37 | 2 | documentation => q{This is the list of affiliations to USF}, | |
| 38 | ); | ||
| 39 | 2 | has 'campus' => ( | |
| 40 | is => 'ro', | ||
| 41 | isa => NonEmptySimpleStr, | ||
| 42 | |||
| 43 | documentation => q{This is the campus the entry is affiliated with}, | ||
| 44 | clearer => '_clear_campus', | ||
| 45 | predicate => 'has_campus', | ||
| 46 | ); | ||
| 47 | 2 | has 'campus_mailstop' => ( | |
| 48 | is => 'ro', | ||
| 49 | isa => NonEmptySimpleStr, | ||
| 50 | |||
| 51 | documentation => q{This is the mailstop for he entry on campus}, | ||
| 52 | clearer => '_clear_campus_mailstop', | ||
| 53 | predicate => 'has_campus_mailstop', | ||
| 54 | ); | ||
| 55 | 2 | has 'campus_phone' => ( | |
| 56 | is => 'ro', | ||
| 57 | isa => NonEmptySimpleStr, | ||
| 58 | |||
| 59 | documentation => q{This is the campus phone number}, | ||
| 60 | clearer => '_clear_campus_phone', | ||
| 61 | predicate => 'has_campus_phone', | ||
| 62 | ); | ||
| 63 | 2 | has 'college' => ( | |
| 64 | is => 'ro', | ||
| 65 | isa => NonEmptySimpleStr, | ||
| 66 | |||
| 67 | documentation => q{This is the college the entry is affiliated with}, | ||
| 68 | clearer => '_clear_college', | ||
| 69 | predicate => 'has_college', | ||
| 70 | ); | ||
| 71 | 2 | has 'email' => ( | |
| 72 | is => 'ro', | ||
| 73 | isa => EmailAddress, | ||
| 74 | |||
| 75 | documentation => q{This is the e-mail address}, | ||
| 76 | clearer => '_clear_email', | ||
| 77 | predicate => 'has_email', | ||
| 78 | ); | ||
| 79 | 2 | has 'family_name' => ( | |
| 80 | is => 'ro', | ||
| 81 | isa => NonEmptySimpleStr, | ||
| 82 | |||
| 83 | documentation => q{This is the family name}, | ||
| 84 | required => 1, | ||
| 85 | ); | ||
| 86 | 2 | has 'first_name' => ( | |
| 87 | is => 'ro', | ||
| 88 | isa => NonEmptySimpleStr, | ||
| 89 | |||
| 90 | documentation => q{This is the first name}, | ||
| 91 | required => 1, | ||
| 92 | ); | ||
| 93 | 2 | has 'given_name' => ( | |
| 94 | is => 'ro', | ||
| 95 | isa => NonEmptySimpleStr, | ||
| 96 | |||
| 97 | documentation => q{This is the given name}, | ||
| 98 | required => 1, | ||
| 99 | ); | ||
| 100 | 2 | has 'middle_name' => ( | |
| 101 | is => 'ro', | ||
| 102 | isa => NonEmptySimpleStr, | ||
| 103 | |||
| 104 | documentation => q{This is the middle name}, | ||
| 105 | clearer => '_clear_middle_name', | ||
| 106 | predicate => 'has_middle_name', | ||
| 107 | ); | ||
| 108 | |||
| 109 | ########################################################################### | ||
| 110 | # METHODS | ||
| 111 | 1 | ▶ | sub full_name { |
|
Subroutine
full_name: called CC=1 SCAR=0.0
Pod
documented
| |||
| 112 | 1 | my ($self) = @_; | |
| 113 | |||
| 114 | # The full name is the given name and family name | ||
| 115 | 1 | return join q{ }, $self->given_name, $self->family_name; | |
| 116 | } | ||
| 117 | |||
| 118 | ########################################################################### | ||
| 119 | # MAKE MOOSE OBJECT IMMUTABLE | ||
| 120 | 2 | __PACKAGE__->meta->make_immutable; | |
| 121 | |||
| 122 | 2 | 1; | |
| 123 | |||
| 124 | __END__ | ||