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

« back to all changes in this revision

Viewing changes to Bio/Biblio/WebResource.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::WebResource
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::WebResource - Representation of a web resource
14
 
 
15
 
=head1 SYNOPSIS
16
 
 
17
 
    $obj = Bio::Biblio::WebResource->new
18
 
                  (-url  => 'http://resources/best.html',
19
 
                   -estimated_size => 45000);
20
 
  # --- OR ---
21
 
 
22
 
    $obj = Bio::Biblio::WebResource->new();
23
 
    $obj->cost ('0.3 EURO');
24
 
 
25
 
=head1 DESCRIPTION
26
 
 
27
 
A storage object for a citation quoting a web resource.
28
 
See its place in the class hierarchy in
29
 
http://www.ebi.ac.uk/~senger/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
 
  url
37
 
  estimated_size
38
 
  cost
39
 
 
40
 
=head1 SEE ALSO
41
 
 
42
 
=over 4
43
 
 
44
 
=item *
45
 
 
46
 
OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
47
 
 
48
 
=item *
49
 
 
50
 
Comments to the Perl client: http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html
51
 
 
52
 
=back
53
 
 
54
 
=head1 FEEDBACK
55
 
 
56
 
=head2 Mailing Lists
57
 
 
58
 
User feedback is an integral part of the evolution of this and other
59
 
Bioperl modules. Send your comments and suggestions preferably to
60
 
the Bioperl mailing list.  Your participation is much appreciated.
61
 
 
62
 
  bioperl-l@bioperl.org                  - General discussion
63
 
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
64
 
 
65
 
=head2 Support 
66
 
 
67
 
Please direct usage questions or support issues to the mailing list:
68
 
 
69
 
I<bioperl-l@bioperl.org>
70
 
 
71
 
rather than to the module maintainer directly. Many experienced and 
72
 
reponsive experts will be able look at the problem and quickly 
73
 
address it. Please include a thorough description of the problem 
74
 
with code and data examples if at all possible.
75
 
 
76
 
=head2 Reporting Bugs
77
 
 
78
 
Report bugs to the Bioperl bug tracking system to help us keep track
79
 
of the bugs and their resolution. Bug reports can be submitted or the
80
 
web:
81
 
 
82
 
  https://redmine.open-bio.org/projects/bioperl/
83
 
 
84
 
=head1 AUTHORS
85
 
 
86
 
Heikki Lehvaslaiho (heikki-at-bioperl-dot-org),
87
 
Martin Senger (senger@ebi.ac.uk)
88
 
 
89
 
=head1 COPYRIGHT
90
 
 
91
 
Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
92
 
 
93
 
This module is free software; you can redistribute it and/or modify
94
 
it under the same terms as Perl itself.
95
 
 
96
 
=head1 DISCLAIMER
97
 
 
98
 
This software is provided "as is" without warranty of any kind.
99
 
 
100
 
=cut
101
 
 
102
 
 
103
 
# Let the code begin...
104
 
 
105
 
 
106
 
package Bio::Biblio::WebResource;
107
 
use strict;
108
 
 
109
 
 
110
 
use base qw(Bio::Biblio::Ref);
111
 
 
112
 
#
113
 
# a closure with a list of allowed attribute names (these names
114
 
# correspond with the allowed 'get' and 'set' methods); each name also
115
 
# keep what type the attribute should be (use 'undef' if it is a
116
 
# simple scalar)
117
 
#
118
 
{
119
 
    my %_allowed = (
120
 
                    _url => undef,
121
 
                    _estimated_size => undef,
122
 
                    _cost => undef,
123
 
                    );
124
 
 
125
 
    # return 1 if $attr is allowed to be set/get in this class
126
 
    sub _accessible {
127
 
        my ($self, $attr) = @_;
128
 
        exists $_allowed{$attr} or $self->SUPER::_accessible ($attr);
129
 
    }
130
 
 
131
 
    # return an expected type of given $attr
132
 
    sub _attr_type {
133
 
        my ($self, $attr) = @_;
134
 
        if (exists $_allowed{$attr}) {
135
 
            return $_allowed{$attr};
136
 
        } else {
137
 
            return $self->SUPER::_attr_type ($attr);
138
 
        }
139
 
    }
140
 
}
141
 
 
142
 
 
143
 
1;
144
 
__END__