Sync'ed RichSeqI with the implementation. RichSeq provides backward
[bioperl-live.git] / Bio / Biblio / PubmedArticle.pm
blobc0d1619d9a56eb104337d2d0cd28d43e449b6e4a
1 # $Id$
3 # BioPerl module for Bio::Biblio::PubmedArticle
5 # Cared for by Martin Senger <senger@ebi.ac.uk>
6 # For copyright and disclaimer see below.
8 # POD documentation - main docs before the code
10 =head1 NAME
12 Bio::Biblio::PubmedArticle - Representation of a PUBMED article
14 =head1 SYNOPSIS
16 $obj = new Bio::Biblio::PubmedArticle
17 (-pubmed_history_list =>
18 [ { 'pub_status' => 'pubmed',
19 'date' => '2001-12-1T10:0:00Z' },
20 { 'pub_status' => 'medline',
21 'date' => '2002-1-5T10:1:00Z' } ],
22 -pubmed_status => 'ppublish');
23 --- OR ---
25 $obj = new Bio::Biblio::PubmedArticle;
26 $obj->pubmed_status ('ppublish');
28 =head1 DESCRIPTION
30 A storage object for a general PUBMED article.
31 See its place in the class hierarchy in
32 http://industry.ebi.ac.uk/openBQS/images/bibobjects_perl.gif
34 =head2 Attributes
36 The following attributes are specific to this class
37 (however, you can also set and get all attributes defined in the parent classes):
39 pubmed_status
40 pubmed_provider_id
41 pubmed_history_list type: array ref of hashes
42 pubmed_article_id_list type: array ref of hashes
43 pubmed_url_list type: array ref of hashes
45 =head1 SEE ALSO
47 =over
49 =item *
51 OpenBQS home page: http://industry.ebi.ac.uk/openBQS
53 =item *
55 Comments to the Perl client: http://industry.ebi.ac.uk/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/MailList.shtml - About the mailing lists
70 =head2 Reporting Bugs
72 Report bugs to the Bioperl bug tracking system to help us keep track
73 of the bugs and their resolution. Bug reports can be submitted via
74 email or the web:
76 bioperl-bugs@bioperl.org
77 http://bugzilla.bioperl.org/
79 =head1 AUTHOR
81 Martin Senger (senger@ebi.ac.uk)
83 =head1 COPYRIGHT
85 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
87 This module is free software; you can redistribute it and/or modify
88 it under the same terms as Perl itself.
90 =head1 DISCLAIMER
92 This software is provided "as is" without warranty of any kind.
94 =cut
97 # Let the code begin...
100 package Bio::Biblio::PubmedArticle;
101 use strict;
102 use vars qw(@ISA);
104 use Bio::Biblio::MedlineArticle;
105 @ISA = qw(Bio::Biblio::MedlineArticle);
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)
114 my %_allowed =
116 _pubmed_status => undef,
117 _pubmed_provider_id => undef,
118 _pubmed_history_list => 'ARRAY',
119 _pubmed_article_id_list => 'ARRAY',
120 _pubmed_url_list => 'ARRAY',
123 # return 1 if $attr is allowed to be set/get in this class
124 sub _accessible {
125 my ($self, $attr) = @_;
126 return 1 if exists $_allowed{$attr};
127 foreach my $parent (@ISA) {
128 return 1 if $parent->_accessible ($attr);
132 # return an expected type of given $attr
133 sub _attr_type {
134 my ($self, $attr) = @_;
135 if (exists $_allowed{$attr}) {
136 return $_allowed{$attr};
137 } else {
138 foreach my $parent (@ISA) {
139 if ($parent->_accessible ($attr)) {
140 return $parent->_attr_type ($attr);
144 return 'unknown';
149 __END__