0
|
1 # $Id: Book.pm,v 1.7 2002/10/22 07:45:11 lapp Exp $
|
|
2 #
|
|
3 # BioPerl module for Bio::Biblio::Book
|
|
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::Book - Representation of a book
|
|
13
|
|
14 =head1 SYNOPSIS
|
|
15
|
|
16 $obj = new Bio::Biblio::Book (-identifier => '123abc',
|
|
17 -editor => new Bio::Biblio::Person
|
|
18 (-lastname => 'Loukides'),
|
|
19 -isbn => '0-596-00068-5');
|
|
20 --- OR ---
|
|
21
|
|
22 $obj = new Bio::Biblio::Book;
|
|
23 $obj->isbn ('0-596-00068-5');
|
|
24
|
|
25 =head1 DESCRIPTION
|
|
26
|
|
27 A storage object for a book.
|
|
28 See its place in the class hierarchy in
|
|
29 http://industry.ebi.ac.uk/openBQS/images/bibobjects_perl.gif
|
|
30
|
|
31 =head2 Attributes
|
|
32
|
|
33 The following attributes are specific to this class
|
|
34 (however, you can also set and get all attributes defined in the parent classes):
|
|
35
|
|
36 edition
|
|
37 editor type: Bio::Biblio::Provider
|
|
38 isbn
|
|
39 series
|
|
40 title
|
|
41 volume
|
|
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::Book;
|
|
100 use strict;
|
|
101 use vars qw(@ISA);
|
|
102
|
|
103 use Bio::Biblio::Ref;
|
|
104
|
|
105 @ISA = qw(Bio::Biblio::Ref);
|
|
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 _edition => undef,
|
|
117 _editor => 'Bio::Biblio::Provider',
|
|
118 _isbn => undef,
|
|
119 _series => undef,
|
|
120 _title => undef,
|
|
121 _volume => undef,
|
|
122 );
|
|
123
|
|
124 # return 1 if $attr is allowed to be set/get in this class
|
|
125 sub _accessible {
|
|
126 my ($self, $attr) = @_;
|
|
127 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr);
|
|
128 }
|
|
129
|
|
130 # return an expected type of given $attr
|
|
131 sub _attr_type {
|
|
132 my ($self, $attr) = @_;
|
|
133 if (exists $_allowed{$attr}) {
|
|
134 return $_allowed{$attr};
|
|
135 } else {
|
|
136 return $self->SUPER::_attr_type ($attr);
|
|
137 }
|
|
138 }
|
|
139 }
|
|
140
|
|
141
|
|
142 1;
|
|
143 __END__
|