Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/Biblio/WebResource.pm @ 0:1f6dce3d34e0
Uploaded
| author | mahtabm |
|---|---|
| date | Thu, 11 Apr 2013 02:01:53 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:1f6dce3d34e0 |
|---|---|
| 1 # $Id: WebResource.pm,v 1.6 2002/10/22 07:45:11 lapp Exp $ | |
| 2 # | |
| 3 # BioPerl module for Bio::Biblio::WebResource | |
| 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::WebResource - Representation of a web resource | |
| 13 | |
| 14 =head1 SYNOPSIS | |
| 15 | |
| 16 $obj = new Bio::Biblio::WebResource | |
| 17 (-url => 'http://resources/best.html', | |
| 18 -estimated_size => 45000); | |
| 19 --- OR --- | |
| 20 | |
| 21 $obj = new Bio::Biblio::WebResource; | |
| 22 $obj->cost ('0.3 EURO'); | |
| 23 | |
| 24 =head1 DESCRIPTION | |
| 25 | |
| 26 A storage object for a citation quoting a web resource. | |
| 27 See its place in the class hierarchy in | |
| 28 http://industry.ebi.ac.uk/openBQS/images/bibobjects_perl.gif | |
| 29 | |
| 30 =head2 Attributes | |
| 31 | |
| 32 The following attributes are specific to this class | |
| 33 (however, you can also set and get all attributes defined in the parent classes): | |
| 34 | |
| 35 url | |
| 36 estimated_size | |
| 37 cost | |
| 38 | |
| 39 =head1 SEE ALSO | |
| 40 | |
| 41 =over | |
| 42 | |
| 43 =item * | |
| 44 | |
| 45 OpenBQS home page: http://industry.ebi.ac.uk/openBQS | |
| 46 | |
| 47 =item * | |
| 48 | |
| 49 Comments to the Perl client: http://industry.ebi.ac.uk/openBQS/Client_perl.html | |
| 50 | |
| 51 =back | |
| 52 | |
| 53 =head1 FEEDBACK | |
| 54 | |
| 55 =head2 Mailing Lists | |
| 56 | |
| 57 User feedback is an integral part of the evolution of this and other | |
| 58 Bioperl modules. Send your comments and suggestions preferably to | |
| 59 the Bioperl mailing list. Your participation is much appreciated. | |
| 60 | |
| 61 bioperl-l@bioperl.org - General discussion | |
| 62 http://bioperl.org/MailList.shtml - About the mailing lists | |
| 63 | |
| 64 =head2 Reporting Bugs | |
| 65 | |
| 66 Report bugs to the Bioperl bug tracking system to help us keep track | |
| 67 of the bugs and their resolution. Bug reports can be submitted via | |
| 68 email or the web: | |
| 69 | |
| 70 bioperl-bugs@bioperl.org | |
| 71 http://bugzilla.bioperl.org/ | |
| 72 | |
| 73 =head1 AUTHORS | |
| 74 | |
| 75 Heikki Lehvaslaiho (heikki@ebi.ac.uk), | |
| 76 Martin Senger (senger@ebi.ac.uk) | |
| 77 | |
| 78 =head1 COPYRIGHT | |
| 79 | |
| 80 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved. | |
| 81 | |
| 82 This module is free software; you can redistribute it and/or modify | |
| 83 it under the same terms as Perl itself. | |
| 84 | |
| 85 =head1 DISCLAIMER | |
| 86 | |
| 87 This software is provided "as is" without warranty of any kind. | |
| 88 | |
| 89 =cut | |
| 90 | |
| 91 | |
| 92 # Let the code begin... | |
| 93 | |
| 94 | |
| 95 package Bio::Biblio::WebResource; | |
| 96 use strict; | |
| 97 use vars qw(@ISA); | |
| 98 | |
| 99 use Bio::Biblio::Ref; | |
| 100 | |
| 101 @ISA = qw( Bio::Biblio::Ref); | |
| 102 | |
| 103 # | |
| 104 # a closure with a list of allowed attribute names (these names | |
| 105 # correspond with the allowed 'get' and 'set' methods); each name also | |
| 106 # keep what type the attribute should be (use 'undef' if it is a | |
| 107 # simple scalar) | |
| 108 # | |
| 109 { | |
| 110 my %_allowed = ( | |
| 111 _url => undef, | |
| 112 _estimated_size => undef, | |
| 113 _cost => undef, | |
| 114 ); | |
| 115 | |
| 116 # return 1 if $attr is allowed to be set/get in this class | |
| 117 sub _accessible { | |
| 118 my ($self, $attr) = @_; | |
| 119 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); | |
| 120 } | |
| 121 | |
| 122 # return an expected type of given $attr | |
| 123 sub _attr_type { | |
| 124 my ($self, $attr) = @_; | |
| 125 if (exists $_allowed{$attr}) { | |
| 126 return $_allowed{$attr}; | |
| 127 } else { | |
| 128 return $self->SUPER::_attr_type ($attr); | |
| 129 } | |
| 130 } | |
| 131 } | |
| 132 | |
| 133 | |
| 134 1; | |
| 135 __END__ |
