Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/Biblio/Article.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: Article.pm,v 1.7 2002/10/22 07:45:11 lapp Exp $ | |
| 2 # | |
| 3 # BioPerl module for Bio::Biblio::Article | |
| 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::Article - Representation of a general article | |
| 13 | |
| 14 =head1 SYNOPSIS | |
| 15 | |
| 16 $obj = new Bio::Biblio::Article (-identifier => '123abc', | |
| 17 -first_page => 23, | |
| 18 -last_page => 68); | |
| 19 --- OR --- | |
| 20 | |
| 21 $obj = new Bio::Biblio::Article; | |
| 22 $obj->identifier ('123abc'); | |
| 23 $obj->first_page (23); | |
| 24 $obj->last_page (68); | |
| 25 | |
| 26 =head1 DESCRIPTION | |
| 27 | |
| 28 A storage object for a general article. | |
| 29 See its place in the class hierarchy in | |
| 30 http://industry.ebi.ac.uk/openBQS/images/bibobjects_perl.gif | |
| 31 | |
| 32 =head2 Attributes | |
| 33 | |
| 34 The following attributes are specific to this class | |
| 35 (however, you can also set and get all attributes defined in the parent classes): | |
| 36 | |
| 37 first_page | |
| 38 last_page | |
| 39 | |
| 40 | |
| 41 =head1 SEE ALSO | |
| 42 | |
| 43 =over | |
| 44 | |
| 45 =item * | |
| 46 | |
| 47 OpenBQS home page: http://industry.ebi.ac.uk/openBQS | |
| 48 | |
| 49 =item * | |
| 50 | |
| 51 Comments to the Perl client: http://industry.ebi.ac.uk/openBQS/Client_perl.html | |
| 52 | |
| 53 =back | |
| 54 | |
| 55 =head1 FEEDBACK | |
| 56 | |
| 57 =head2 Mailing Lists | |
| 58 | |
| 59 User feedback is an integral part of the evolution of this and other | |
| 60 Bioperl modules. Send your comments and suggestions preferably to | |
| 61 the Bioperl mailing list. Your participation is much appreciated. | |
| 62 | |
| 63 bioperl-l@bioperl.org - General discussion | |
| 64 http://bioperl.org/MailList.shtml - About the mailing lists | |
| 65 | |
| 66 =head2 Reporting Bugs | |
| 67 | |
| 68 Report bugs to the Bioperl bug tracking system to help us keep track | |
| 69 of the bugs and their resolution. Bug reports can be submitted via | |
| 70 email or the web: | |
| 71 | |
| 72 bioperl-bugs@bioperl.org | |
| 73 http://bugzilla.bioperl.org/ | |
| 74 | |
| 75 =head1 AUTHORS | |
| 76 | |
| 77 Heikki Lehvaslaiho (heikki@ebi.ac.uk), | |
| 78 Martin Senger (senger@ebi.ac.uk) | |
| 79 | |
| 80 =head1 COPYRIGHT | |
| 81 | |
| 82 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved. | |
| 83 | |
| 84 This module is free software; you can redistribute it and/or modify | |
| 85 it under the same terms as Perl itself. | |
| 86 | |
| 87 =head1 DISCLAIMER | |
| 88 | |
| 89 This software is provided "as is" without warranty of any kind. | |
| 90 | |
| 91 =cut | |
| 92 | |
| 93 | |
| 94 # Let the code begin... | |
| 95 | |
| 96 | |
| 97 package Bio::Biblio::Article; | |
| 98 use strict; | |
| 99 use vars qw(@ISA); | |
| 100 | |
| 101 use Bio::Biblio::Ref; | |
| 102 | |
| 103 @ISA = qw( Bio::Biblio::Ref); | |
| 104 | |
| 105 # | |
| 106 # a closure with a list of allowed attribute names (these names | |
| 107 # correspond with the allowed 'get' and 'set' methods); each name also | |
| 108 # keep what type the attribute should be (use 'undef' if it is a | |
| 109 # simple scalar) | |
| 110 # | |
| 111 { | |
| 112 my %_allowed = | |
| 113 ( | |
| 114 _first_page => undef, | |
| 115 _last_page => undef, | |
| 116 ); | |
| 117 | |
| 118 # return 1 if $attr is allowed to be set/get in this class | |
| 119 sub _accessible { | |
| 120 my ($self, $attr) = @_; | |
| 121 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); | |
| 122 } | |
| 123 | |
| 124 # return an expected type of given $attr | |
| 125 sub _attr_type { | |
| 126 my ($self, $attr) = @_; | |
| 127 if (exists $_allowed{$attr}) { | |
| 128 return $_allowed{$attr}; | |
| 129 } else { | |
| 130 return $self->SUPER::_attr_type ($attr); | |
| 131 } | |
| 132 } | |
| 133 } | |
| 134 | |
| 135 | |
| 136 1; | |
| 137 __END__ |
