File Coverage

blib/lib/Parse/SAMGov/Entity/PointOfContact.pm
Criterion Covered Total %
statement 35 35 100.0
branch 17 26 65.3
condition 2 3 66.6
subroutine 7 7 100.0
pod n/a
total 61 71 85.9


line stmt bran cond sub pod time code
1             package Parse::SAMGov::Entity::PointOfContact;
2             $Parse::SAMGov::Entity::PointOfContact::VERSION = '0.104';
3 3     3   11 use strict;
  3         4  
  3         72  
4 3     3   11 use warnings;
  3         4  
  3         58  
5 3     3   42 use 5.010;
  3         7  
6 3     3   13 use Parse::SAMGov::Mo;
  3         4  
  3         15  
7             extends 'Parse::SAMGov::Entity::Address';
8 3     3   1297 use Email::Valid;
  3         208335  
  3         625  
9              
10             #ABSTRACT: Defines the Point of Contact object of the entity.
11              
12              
13             use overload
14             fallback => 1,
15             '""' => sub {
16 92     92   65 my $str = '';
17 92 100 66     122 if (length $_[0]->first and length $_[0]->last) {
18 60         78 $str .= $_[0]->first;
19 60 100       89 $str .= ' ' . $_[0]->middle if length $_[0]->middle;
20 60         86 $str .= ' ' . $_[0]->last;
21 60 100       91 $str .= ', ' . $_[0]->title if length $_[0]->title;
22 60 50       92 $str .= ', ' . $_[0]->address if length $_[0]->address;
23 60 50       85 $str .= ', ' . $_[0]->city if length $_[0]->city;
24 60 50       108 $str .= ', ' . $_[0]->state if length $_[0]->state;
25 60 50       88 $str .= ', ' . $_[0]->country if length $_[0]->country;
26 60 50       99 $str .= ' - ' . $_[0]->zip if length $_[0]->zip;
27 60 50       90 $str .= '. Email: ' . $_[0]->email if $_[0]->email;
28 60 50       91 $str .= '. Phone: ' . $_[0]->phone if $_[0]->phone;
29 60 50       86 $str .= ' x' . $_[0]->phone_ext if $_[0]->phone_ext;
30 60 100       87 $str .= '. Fax: ' . $_[0]->fax if $_[0]->fax;
31 60 50       87 $str .= '. Phone(non-US): ' . $_[0]->phone_nonUS if $_[0]->phone_nonUS;
32 60         55 $str .= '.';
33             }
34 92         172 return $str;
35 3     3   18 };
  3         3  
  3         25  
36              
37             has 'first';
38             has 'middle';
39             has 'last';
40             has 'title';
41             has 'phone';
42             has 'phone_ext';
43             has 'phone_nonUS';
44             has 'fax';
45             has 'email' => coerce => sub { Email::Valid->address($_[0]); };
46              
47             1;
48              
49             =pod
50              
51             =encoding UTF-8
52              
53             =head1 NAME
54              
55             Parse::SAMGov::Entity::PointOfContact - Defines the Point of Contact object of the entity.
56              
57             =head1 VERSION
58              
59             version 0.104
60              
61             =head1 SYNOPSIS
62              
63             my $addr = Parse::SAMGov::Entity::PointOfContact->new(
64             first => 'John',
65             middle => 'F',
66             last => 'Jameson',
67             title => 'CEO',
68             address => '123 Baker Street, Suite 1A',
69             city => 'Boringville',
70             state => 'ZB',
71             country => 'USA',
72             zip => '21900-1234',
73             phone => '18888888888',
74             phone_ext => '101',
75             fax => '18887777777',
76             phone_nonUS => '442222222222',
77             email => 'abc@pqr.com',
78             );
79              
80             =head1 METHODS
81              
82             =head2 new
83              
84             Creates a new Point of Contact object for the entity or individual. This
85             inherits all the methods of the L object.
86              
87             =head2 first
88              
89             Get/Set the first name of the point of contact.
90              
91             =head2 middle
92              
93             Get/Set the middle initial of the point of contact.
94              
95             =head2 last
96              
97             Get/Set the last name of the point of contact.
98              
99             =head2 title
100              
101             Get/Set the title of the point of contact. Example is CEO, President, etc.
102              
103             =head2 phone
104              
105             Get/Set the U.S. Phone number of the point of contact.
106              
107             =head2 phone_ext
108              
109             Get/Set the U.S. Phone number extension of the point of contact if any.
110              
111             =head2 phone_nonUS
112              
113             Get/Set the non-U.S. phone number of the point of contact.
114              
115             =head2 fax
116              
117             Get/Set the fax number of the point of contact.
118              
119             =head2 email
120              
121             Get/Set the email of the point of contact.
122              
123             =head1 AUTHOR
124              
125             Vikas N Kumar
126              
127             =head1 COPYRIGHT AND LICENSE
128              
129             This software is copyright (c) 2016 by Selective Intellect LLC.
130              
131             This is free software; you can redistribute it and/or modify it under
132             the same terms as the Perl 5 programming language system itself.
133              
134             =cut
135              
136             __END__