WWW::USF::Directory::Entry - An entry in the USF online directory


WWW-USF-Directory documentation Contained in the WWW-USF-Directory distribution.

Index


Code Index:

NAME

Top

WWW::USF::Directory::Entry - An entry in the USF online directory

VERSION

Top

Version 0.003

SYNOPSIS

Top

  # Print the family name
  say $entry->family_name;

DESCRIPTION

Top

This represents an entry in the USF online directory. These objects are typically created by WWW::USF::Directory.

CONSTRUCTOR

Top

This is fully object-oriented, and as such before any method can be used, the constructor needs to be called to create an object to work with.

new

This will construct a new object.

new(%attributes)

%attributes is a HASH where the keys are attributes (specified in the ATTRIBUTES section).

new($attributes)

$attributes is a HASHREF where the keys are attributes (specified in the ATTRIBUTES section).

ATTRIBUTES

Top

  # Set an attribute
  $object->attribute_name($new_value);

  # Get an attribute
  my $value = $object->attribute_name;

affiliations

This is the list of affiliations to USF as WWW::USF::Directory::Entry::Affiliation objects.

campus

This is the campus the entry is affiliated with.

campus_mailstop

This is the mailstop for he entry on campus.

campus_phone

This is the campus phone number.

college

This is the college the entry is affiliated with.

email

This is the e-mail address.

family_name

This is the family name.

first_name

This is the first name.

given_name

This is the given name.

middle_name

This is the middle name.

METHODS

Top

full_name

This will return the full name, which is the given name and the family name joined with a space.

has_campus

This returns a Boolean of if the campus attribute is set.

has_campus_mailstop

This returns a Boolean of if the campus_mailstop attribute is set.

has_campus_phone

This returns a Boolean of if the campus_phone attribute is set.

has_college

This returns a Boolean of if the college attribute is set.

has_email

This returns a Boolean of if the email attribute is set.

has_middle_name

This returns a Boolean of if the middle_name attribute is set.

DEPENDENCIES

Top

* Moose 0.89
* MooseX::StrictConstructor 0.08
* MooseX::Types::Moose
* namespace::clean 0.04

AUTHOR

Top

Douglas Christopher Wilson, <doug at somethingdoug.com>

BUGS AND LIMITATIONS

Top

Please report any bugs or feature requests to bug-www-usf-directory at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-USF-Directory. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

  perldoc WWW::USF::Directory

You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-USF-Directory

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/WWW-USF-Directory

* CPAN Ratings

http://cpanratings.perl.org/d/WWW-USF-Directory

* Search CPAN

http://search.cpan.org/dist/WWW-USF-Directory/

LICENSE AND COPYRIGHT

Top


WWW-USF-Directory documentation Contained in the WWW-USF-Directory distribution.

package WWW::USF::Directory::Entry;

use 5.008001;
use strict;
use warnings 'all';

###########################################################################
# METADATA
our $AUTHORITY = 'cpan:DOUGDUDE';
our $VERSION   = '0.003';

###########################################################################
# MOOSE
use Moose 0.89;
use MooseX::StrictConstructor 0.08;

###########################################################################
# MOOSE TYPES
use MooseX::Types::Common::String qw(
	NonEmptySimpleStr
);
use MooseX::Types::Email qw(
	EmailAddress
);

###########################################################################
# ALL IMPORTS BEFORE THIS WILL BE ERASED
use namespace::clean 0.04 -except => [qw(meta)];

###########################################################################
# ATTRIBUTES
has 'affiliations' => (
	is  => 'ro',
	isa => 'ArrayRef[WWW::USF::Directory::Entry::Affiliation]',

	default       => sub { [] },
	documentation => q{This is the list of affiliations to USF},
);
has 'campus' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the campus the entry is affiliated with},
	clearer       => '_clear_campus',
	predicate     => 'has_campus',
);
has 'campus_mailstop' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the mailstop for he entry on campus},
	clearer       => '_clear_campus_mailstop',
	predicate     => 'has_campus_mailstop',
);
has 'campus_phone' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the campus phone number},
	clearer       => '_clear_campus_phone',
	predicate     => 'has_campus_phone',
);
has 'college' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the college the entry is affiliated with},
	clearer       => '_clear_college',
	predicate     => 'has_college',
);
has 'email' => (
	is  => 'ro',
	isa => EmailAddress,

	documentation => q{This is the e-mail address},
	clearer       => '_clear_email',
	predicate     => 'has_email',
);
has 'family_name' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the family name},
	required      => 1,
);
has 'first_name' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the first name},
	required      => 1,
);
has 'given_name' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the given name},
	required      => 1,
);
has 'middle_name' => (
	is  => 'ro',
	isa => NonEmptySimpleStr,

	documentation => q{This is the middle name},
	clearer       => '_clear_middle_name',
	predicate     => 'has_middle_name',
);

###########################################################################
# METHODS
sub full_name {
	my ($self) = @_;

	# The full name is the given name and family name
	return join q{ }, $self->given_name, $self->family_name;
}

###########################################################################
# MAKE MOOSE OBJECT IMMUTABLE
__PACKAGE__->meta->make_immutable;

1;

__END__