~ubuntu-branches/ubuntu/trusty/bioperl/trusty

« back to all changes in this revision

Viewing changes to Bio/Biblio/PubmedBookArticle.pm

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2013-09-22 13:39:48 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20130922133948-c6z62zegjyp7ztou
Tags: 1.6.922-1
* New upstream release.
* Replaces and Breaks grinder (<< 0.5.3-3~) because of overlaping contents.
  Closes: #722910
* Stop Replacing and Breaking bioperl ( << 1.6.9 ): not needed anymore. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# BioPerl module for Bio::Biblio::PubmedBookArticle
3
 
#
4
 
# Please direct questions and support issues to <bioperl-l@bioperl.org> 
5
 
#
6
 
# Cared for by Martin Senger <senger@ebi.ac.uk>
7
 
# For copyright and disclaimer see below.
8
 
 
9
 
# POD documentation - main docs before the code
10
 
 
11
 
=head1 NAME
12
 
 
13
 
Bio::Biblio::PubmedBookArticle - Representation of a PUBMED book article
14
 
 
15
 
=head1 SYNOPSIS
16
 
 
17
 
    $obj = Bio::Biblio::PubmedBookArticle->new
18
 
                  (-title => 'Still getting started'.
19
 
                   -book => Bio::Biblio::MedlineBook->new());
20
 
    # note that there is no specialised class PubmedBook
21
 
 
22
 
  #--- OR ---
23
 
 
24
 
    $obj = Bio::Biblio::PubmedBookArticle->new();
25
 
    $obj->title ('Still getting started');
26
 
 
27
 
=head1 DESCRIPTION
28
 
 
29
 
A storage object for a PUBMED book article.
30
 
See its place in the class hierarchy in
31
 
http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif
32
 
 
33
 
=head2 Attributes
34
 
 
35
 
There are no specific attributes in this class
36
 
(however, you can set and get all attributes defined in the parent classes).
37
 
 
38
 
=head1 SEE ALSO
39
 
 
40
 
=over 4
41
 
 
42
 
=item *
43
 
 
44
 
OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
45
 
 
46
 
=item *
47
 
 
48
 
Comments to the Perl client: http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html
49
 
 
50
 
=back
51
 
 
52
 
=head1 FEEDBACK
53
 
 
54
 
=head2 Mailing Lists
55
 
 
56
 
User feedback is an integral part of the evolution of this and other
57
 
Bioperl modules. Send your comments and suggestions preferably to
58
 
the Bioperl mailing list.  Your participation is much appreciated.
59
 
 
60
 
  bioperl-l@bioperl.org                  - General discussion
61
 
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
62
 
 
63
 
=head2 Support 
64
 
 
65
 
Please direct usage questions or support issues to the mailing list:
66
 
 
67
 
I<bioperl-l@bioperl.org>
68
 
 
69
 
rather than to the module maintainer directly. Many experienced and 
70
 
reponsive experts will be able look at the problem and quickly 
71
 
address it. Please include a thorough description of the problem 
72
 
with code and data examples if at all possible.
73
 
 
74
 
=head2 Reporting Bugs
75
 
 
76
 
Report bugs to the Bioperl bug tracking system to help us keep track
77
 
of the bugs and their resolution. Bug reports can be submitted via the
78
 
web:
79
 
 
80
 
  https://redmine.open-bio.org/projects/bioperl/
81
 
 
82
 
=head1 AUTHOR
83
 
 
84
 
Martin Senger (senger@ebi.ac.uk)
85
 
 
86
 
=head1 COPYRIGHT
87
 
 
88
 
Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
89
 
 
90
 
This module is free software; you can redistribute it and/or modify
91
 
it under the same terms as Perl itself.
92
 
 
93
 
=head1 DISCLAIMER
94
 
 
95
 
This software is provided "as is" without warranty of any kind.
96
 
 
97
 
=cut
98
 
 
99
 
 
100
 
# Let the code begin...
101
 
 
102
 
 
103
 
package Bio::Biblio::PubmedBookArticle;
104
 
use strict;
105
 
use vars qw(@ISA);
106
 
 
107
 
use base qw(Bio::Biblio::PubmedArticle Bio::Biblio::MedlineBookArticle);
108
 
 
109
 
#
110
 
# a closure with a list of allowed attribute names (these names
111
 
# correspond with the allowed 'get' and 'set' methods); each name also
112
 
# keep what type the attribute should be (use 'undef' if it is a
113
 
# simple scalar)
114
 
#
115
 
{
116
 
    my %_allowed =
117
 
        (
118
 
         );
119
 
 
120
 
    # return 1 if $attr is allowed to be set/get in this class
121
 
    sub _accessible {
122
 
        my ($self, $attr) = @_;
123
 
        return 1 if exists $_allowed{$attr};
124
 
        foreach my $parent (@ISA) {
125
 
            return 1 if $parent->_accessible ($attr);
126
 
        }
127
 
    }
128
 
 
129
 
    # return an expected type of given $attr
130
 
    sub _attr_type {
131
 
        my ($self, $attr) = @_;
132
 
        if (exists $_allowed{$attr}) {
133
 
            return $_allowed{$attr};
134
 
        } else {
135
 
            foreach my $parent (@ISA) {
136
 
                if ($parent->_accessible ($attr)) {
137
 
                    return $parent->_attr_type ($attr);
138
 
                }
139
 
            }
140
 
        }
141
 
        return 'unknown';
142
 
    }
143
 
}
144
 
 
145
 
 
146
 
1;
147
 
__END__