~ubuntu-branches/ubuntu/trusty/bioperl/trusty

« back to all changes in this revision

Viewing changes to Bio/Biblio/Person.pm

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2013-09-22 13:39:48 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20130922133948-c6z62zegjyp7ztou
Tags: 1.6.922-1
* New upstream release.
* Replaces and Breaks grinder (<< 0.5.3-3~) because of overlaping contents.
  Closes: #722910
* Stop Replacing and Breaking bioperl ( << 1.6.9 ): not needed anymore. 

Show diffs side-by-side

added added

removed removed

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