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