sync w/ main trunk
[bioperl-live.git] / Bio / Biblio / Person.pm
blob6ad1b0f67c29301846b9fc3cff34f2372a713cbf
1 # $Id$
3 # BioPerl module for Bio::Biblio::Person
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Martin Senger <senger@ebi.ac.uk>
8 # For copyright and disclaimer see below.
10 # POD documentation - main docs before the code
12 =head1 NAME
14 Bio::Biblio::Person - Representation of a person
16 =head1 SYNOPSIS
18 $obj = Bio::Biblio::Person->new(-lastname => 'Capek',
19 -firstname => 'Karel');
20 #--- OR ---
22 $obj = Bio::Biblio::Person->new();
23 $obj->firstname ('Karel');
24 $obj->lastname ('Capek');
26 =head1 DESCRIPTION
28 A storage object for a person related to a bibliographic resource.
30 =head2 Attributes
32 The following attributes are specific to this class
33 (however, you can also set and get all attributes defined in the parent classes):
35 affiliation
36 email
37 firstname
38 forename
39 initials
40 lastname
41 middlename
42 postal_address
43 suffix
45 =head1 SEE ALSO
47 =over 4
49 =item *
51 OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
53 =item *
55 Comments to the Perl client: http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html
57 =back
59 =head1 FEEDBACK
61 =head2 Mailing Lists
63 User feedback is an integral part of the evolution of this and other
64 Bioperl modules. Send your comments and suggestions preferably to
65 the Bioperl mailing list. Your participation is much appreciated.
67 bioperl-l@bioperl.org - General discussion
68 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
70 =head2 Support
72 Please direct usage questions or support issues to the mailing list:
74 L<bioperl-l@bioperl.org>
76 rather than to the module maintainer directly. Many experienced and
77 reponsive experts will be able look at the problem and quickly
78 address it. Please include a thorough description of the problem
79 with code and data examples if at all possible.
81 =head2 Reporting Bugs
83 Report bugs to the Bioperl bug tracking system to help us keep track
84 of the bugs and their resolution. Bug reports can be submitted via the
85 web:
87 http://bugzilla.open-bio.org/
89 =head1 AUTHORS
91 Heikki Lehvaslaiho (heikki-at-bioperl-dot-org)
92 Martin Senger (senger@ebi.ac.uk)
94 =head1 COPYRIGHT
96 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
98 This module is free software; you can redistribute it and/or modify
99 it under the same terms as Perl itself.
101 =head1 DISCLAIMER
103 This software is provided "as is" without warranty of any kind.
105 =cut
108 # Let the code begin...
111 package Bio::Biblio::Person;
112 use strict;
115 use base qw(Bio::Biblio::Provider);
118 # a closure with a list of allowed attribute names (these names
119 # correspond with the allowed 'get' and 'set' methods); each name also
120 # keep what type the attribute should be (use 'undef' if it is a
121 # simple scalar)
124 my %_allowed =
126 _affiliation => undef,
127 _email => undef,
128 _firstname => undef,
129 _forename => undef,
130 _initials => undef,
131 _lastname => undef,
132 _middlename => undef,
133 _postal_address => undef,
134 _suffix => undef,
137 # return 1 if $attr is allowed to be set/get in this class
138 sub _accessible {
139 my ($self, $attr) = @_;
140 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr);
143 # return an expected type of given $attr
144 sub _attr_type {
145 my ($self, $attr) = @_;
146 if (exists $_allowed{$attr}) {
147 return $_allowed{$attr};
148 } else {
149 return $self->SUPER::_attr_type ($attr);
156 __END__