ensembl-hive  2.6
Configurable.pm
Go to the documentation of this file.
1 =pod
2 
3 =head1 NAME
4 
6 
7 =head1 DESCRIPTION
8 
9  A base class for objects that we want to be configurable in the following sense:
10  1) have a pointer to the $config
11  2) know their context
12  3) automatically apply that context when getting and setting
13 
14 =head1 LICENSE
15 
16  Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
17  Copyright [2016-2024] EMBL-European Bioinformatics Institute
18 
19  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
20  You may obtain a copy of the License at
21 
22  http://www.apache.org/licenses/LICENSE-2.0
23 
24  Unless required by applicable law or agreed to in writing, software distributed under the License
25  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26  See the License for the specific language governing permissions and limitations under the License.
27 
28 =head1 CONTACT
29 
30  Please subscribe to the Hive mailing list: http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users to discuss Hive-related questions or to be notified of our updates
31 
32 =cut
33 
34 
36 
37 use strict;
38 use warnings;
39 
40 
41 sub config {
42  my $self = shift @_;
43 
44  if(@_) {
45  $self->{'_config'} = shift @_;
46  }
47  return $self->{'_config'};
48 }
49 
50 
51 sub context {
52  my $self = shift @_;
53 
54  if(@_) {
55  $self->{'_context'} = shift @_;
56  }
57  return $self->{'_context'};
58 }
59 
60 
61 sub config_get {
62  my $self = shift @_;
63 
64  return $self->config->get( @{$self->context}, @_ );
65 }
66 
67 
68 sub config_set {
69  my $self = shift @_;
70 
71  return $self->config->set( @{$self->context}, @_ );
72 }
73 
74 
75 1;
Bio::EnsEMBL::Hive::Version
Definition: Version.pm:19
Bio::EnsEMBL::Hive::Configurable::config
public config()
Bio::EnsEMBL::Hive::Configurable
Definition: Configurable.pm:12
Bio::EnsEMBL::Hive
Definition: Hive.pm:38