Commit 710bf477 authored by Leo Gordon's avatar Leo Gordon
Browse files

a pilot feature of complex parameter stringificator (more can be introduced later)

parent 7957d92f
......@@ -146,7 +146,8 @@ sub param_substitute {
my $type = ref($structure);
if(!$type) {
$structure=~s/(?:#(\w+?)#)/$self->param($1)/eg;
$structure=~s/(?:#(\w+)\:(\w+)#)/$self->$1($self->param($2))/eg;
$structure=~s/(?:#(\w+)#)/$self->param($1)/eg;
return $structure;
} elsif($type eq 'ARRAY') {
my @substituted_array = ();
......@@ -165,6 +166,12 @@ sub param_substitute {
}
}
sub mysql_conn { # an example stringification formatter (others can be defined here, in a descendent of ProcessWithParams, or in the Runnable)
my ($self, $db_conn) = @_;
return "--host=$db_conn->{-host} --port=$db_conn->{-port} --user='$db_conn->{-user}' --pass='$db_conn->{-pass}' $db_conn->{-dbname}";
}
#--------------------------------------------[private methods]----------------------------------------------
=head2 _parse_string
......
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