[bug 2714]
[bioperl-live.git] / Bio / Biblio / Article.pm
blobd4be65daf5a67397559b5fc9b47e3a04391b9a13
1 # $Id$
3 # BioPerl module for Bio::Biblio::Article
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::Article - Representation of a general article
14 =head1 SYNOPSIS
16 $obj = Bio::Biblio::Article->new(-identifier => '123abc',
17 -first_page => 23,
18 -last_page => 68);
19 #--- OR ---
21 $obj = Bio::Biblio::Article->new();
22 $obj->identifier ('123abc');
23 $obj->first_page (23);
24 $obj->last_page (68);
26 =head1 DESCRIPTION
28 A storage object for a general article.
29 See its place in the class hierarchy in
30 http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif
32 =head2 Attributes
34 The following attributes are specific to this class
35 (however, you can also set and get all attributes defined in the parent classes):
37 first_page
38 last_page
41 =head1 SEE ALSO
43 =over 4
45 =item *
47 OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
49 =item *
51 Comments to the Perl client: http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html
53 =back
55 =head1 FEEDBACK
57 =head2 Mailing Lists
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.
63 bioperl-l@bioperl.org - General discussion
64 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
66 =head2 Reporting Bugs
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 the
70 web:
72 http://bugzilla.open-bio.org/
74 =head1 AUTHORS
76 Heikki Lehvaslaiho (heikki-at-bioperl-dot-org),
77 Martin Senger (senger@ebi.ac.uk)
79 =head1 COPYRIGHT
81 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
83 This module is free software; you can redistribute it and/or modify
84 it under the same terms as Perl itself.
86 =head1 DISCLAIMER
88 This software is provided "as is" without warranty of any kind.
90 =cut
93 # Let the code begin...
96 package Bio::Biblio::Article;
97 use strict;
100 use base qw(Bio::Biblio::Ref);
103 # a closure with a list of allowed attribute names (these names
104 # correspond with the allowed 'get' and 'set' methods); each name also
105 # keep what type the attribute should be (use 'undef' if it is a
106 # simple scalar)
109 my %_allowed =
111 _first_page => undef,
112 _last_page => undef,
115 # return 1 if $attr is allowed to be set/get in this class
116 sub _accessible {
117 my ($self, $attr) = @_;
118 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr);
121 # return an expected type of given $attr
122 sub _attr_type {
123 my ($self, $attr) = @_;
124 if (exists $_allowed{$attr}) {
125 return $_allowed{$attr};
126 } else {
127 return $self->SUPER::_attr_type ($attr);
134 __END__