Commit 586a73ea authored by Leo Gordon's avatar Leo Gordon
Browse files

parameter substitution defined in the parent class

parent 2bb0b66f
......@@ -68,6 +68,14 @@ sub param {
return $self->{'_param_hash'}{$param_name};
}
sub param_substitute {
my ($self, $string) = @_;
$string=~s/(?:#(\w+?)#)/$self->param($1)/eg;
return $string;
}
#--------------------------------------------[private methods]----------------------------------------------
sub _parse_string {
......
......@@ -57,14 +57,9 @@ sub fetch_input {
? $self->db->get_AnalysisDataAdaptor->fetch_by_dbID( $self->param('did') )
: die "Could not find the command defined in input_id(), param('sql') or param('did')";
# Then, run all parameter substitutions:
#
$sql=~s/(?:#(\w+?)#)/$self->param($1)/eg;
# Finally, store the value with substitutions for the actual execution:
#
$self->param('sql', $sql); # store it in one place
# Store the value with parameter substitutions for the actual execution:
#
$self->param('sql', $self->param_substitute($sql));
}
sub run {
......
......@@ -57,14 +57,9 @@ sub fetch_input {
? $self->db->get_AnalysisDataAdaptor->fetch_by_dbID( $self->param('did') )
: die "Could not find the command defined in input_id(), param('cmd') or param('did')";
# Then, run all parameter substitutions:
#
$cmd=~s/(?:#(\w+?)#)/$self->param($1)/eg;
# Finally, store the value with substitutions for the actual execution:
# Store the value with parameter substitutions for the actual execution:
#
$self->param('cmd', $cmd); # store it in one place
$self->param('cmd', $self->param_substitute($cmd));
}
sub run {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment