tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / Biblio / Book.pm
blob6d15e478cb3ebf70d988889613e703668d17719e
1 # $Id$
3 # BioPerl module for Bio::Biblio::Book
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Martin Senger <senger@ebi.ac.uk>
8 # For copyright and disclaimer see below.
10 # POD documentation - main docs before the code
12 =head1 NAME
14 Bio::Biblio::Book - Representation of a book
16 =head1 SYNOPSIS
18 $obj = Bio::Biblio::Book->new(-identifier => '123abc',
19 -editor => Bio::Biblio::Person->new
20 (-lastname => 'Loukides'),
21 -isbn => '0-596-00068-5');
22 #--- OR ---
24 $obj = Bio::Biblio::Book->new();
25 $obj->isbn ('0-596-00068-5');
27 =head1 DESCRIPTION
29 A storage object for a book.
30 See its place in the class hierarchy in
31 http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif
33 =head2 Attributes
35 The following attributes are specific to this class
36 (however, you can also set and get all attributes defined in the parent classes):
38 edition
39 editor type: Bio::Biblio::Provider
40 isbn
41 series
42 title
43 volume
45 =head1 SEE ALSO
47 =over 4
49 =item *
51 OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
53 =item *
55 Comments to the Perl client: http://www.ebi.ac.uk/~senger/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/wiki/Mailing_lists - About the mailing lists
70 =head2 Support
72 Please direct usage questions or support issues to the mailing list:
74 I<bioperl-l@bioperl.org>
76 rather than to the module maintainer directly. Many experienced and
77 reponsive experts will be able look at the problem and quickly
78 address it. Please include a thorough description of the problem
79 with code and data examples if at all possible.
81 =head2 Reporting Bugs
83 Report bugs to the Bioperl bug tracking system to help us keep track
84 of the bugs and their resolution. Bug reports can be submitted via the
85 web:
87 http://bugzilla.open-bio.org/
89 =head1 AUTHORS
91 Heikki Lehvaslaiho (heikki-at-bioperl-dot-org),
92 Martin Senger (senger@ebi.ac.uk)
94 =head1 COPYRIGHT
96 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
98 This module is free software; you can redistribute it and/or modify
99 it under the same terms as Perl itself.
101 =head1 DISCLAIMER
103 This software is provided "as is" without warranty of any kind.
105 =cut
108 # Let the code begin...
111 package Bio::Biblio::Book;
112 use strict;
115 use base qw(Bio::Biblio::Ref);
118 # a closure with a list of allowed attribute names (these names
119 # correspond with the allowed 'get' and 'set' methods); each name also
120 # keep what type the attribute should be (use 'undef' if it is a
121 # simple scalar)
124 my %_allowed =
126 _edition => undef,
127 _editor => 'Bio::Biblio::Provider',
128 _isbn => undef,
129 _series => undef,
130 _title => undef,
131 _volume => undef,
134 # return 1 if $attr is allowed to be set/get in this class
135 sub _accessible {
136 my ($self, $attr) = @_;
137 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr);
140 # return an expected type of given $attr
141 sub _attr_type {
142 my ($self, $attr) = @_;
143 if (exists $_allowed{$attr}) {
144 return $_allowed{$attr};
145 } else {
146 return $self->SUPER::_attr_type ($attr);
153 __END__