maint: restructure to use Dist::Zilla
[bioperl-live.git] / lib / Bio / Tools / Run / GenericParameters.pm
blob43eb058d266c9506cad6a45f6c513c3e2ad40886
2 # BioPerl module for wrapping runtime parameters
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Chad Matsalla (bioinformatics1 at dieselwurks dot com)
8 # Copyright Chad Matsalla
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::Tools::Run::GenericParameters - An object for the parameters used to run programs
18 =head1 SYNOPSIS
20 my $void = $obj->set_parameter("parameter_name","parameter_value");
21 my $value = $obj->get_parameter("parameter_name");
23 =head1 DESCRIPTION
25 This is a basic container to hold the parameters used to run a
26 program. This module may get incorporated into the more generic
27 Bio::Tools::Run framework in bioperl-run distribution.
29 =head1 FEEDBACK
31 =head2 Mailing Lists
33 User feedback is an integral part of the evolution of this and other
34 Bioperl modules. Send your comments and suggestions preferably to
35 the Bioperl mailing list. Your participation is much appreciated.
37 bioperl-l@bioperl.org - General discussion
38 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
40 =head2 Support
42 Please direct usage questions or support issues to the mailing list:
44 I<bioperl-l@bioperl.org>
46 rather than to the module maintainer directly. Many experienced and
47 reponsive experts will be able look at the problem and quickly
48 address it. Please include a thorough description of the problem
49 with code and data examples if at all possible.
51 =head2 Reporting Bugs
53 Report bugs to the Bioperl bug tracking system to help us keep track
54 of the bugs and their resolution. Bug reports can be submitted via the
55 web:
57 https://github.com/bioperl/bioperl-live/issues
59 =head1 AUTHOR - Chad Matsalla
61 Email bioinformatics1 at dieselwurks dot com
63 =head1 CONTRIBUTORS
65 Sendu Bala, bix@sendu.me.uk
67 =head1 APPENDIX
69 The rest of the documentation details each of the object methods.
70 Internal methods are usually preceded with a _
72 =cut
74 # Let the code begin...
76 package Bio::Tools::Run::GenericParameters;
77 use strict;
79 use base qw(Bio::Root::Root Bio::Tools::Run::ParametersI);
81 sub new {
82 my ($class, @args) = @_;
83 my $self = $class->SUPER::new(@args);
84 return $self;
87 =head2 get_parameter
89 Title : get_parameter
90 Usage : $parameter_object->get_parameter($param_name);
91 Function: Get the value of a parameter named $param_name
92 Returns : A scalar that should be a string
93 Args : A scalar that should be a string
95 =cut
97 sub get_parameter {
98 my ($self,$arg) = @_;
99 return $self->{params}->{$arg};
102 =head2 set_parameter
104 Title : set_parameter
105 Usage : $parameter_object->set_parameter($param_name => $param_value);
106 Function: Set the value of a parameter named $param_name to $param_value
107 Returns : Void
108 Args : A hash containing name=>value pairs
110 =cut
112 sub set_parameter {
113 my ($self,$name,$value) = @_;
114 $self->{params}->{$name} = $value;
117 =head2 available_parameters
119 Title : available_parameters
120 Usage : my @paramnames = $parameter_object->available_parameters
121 Function: Returns the names of the available parameters
122 Returns : list of available parameter names
123 Args : none
125 =cut
127 sub available_parameters {
128 my $self = shift;
129 return keys %{$self->{params}};