-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Moose] ConfigOB - grepping the boolean config settings using ConfigOB #500
[Moose] ConfigOB - grepping the boolean config settings using ConfigOB #500
Conversation
) | ||
&& (NeuroDB::DBI::getConfigSetting($this->{dbhr},'createCandidates')) | ||
my $configOB = $this->{'configOB'}; | ||
if (!NeuroDB::MRI::subjectIDExists($subjectIDsref->{'CandID'}, $this->{dbhr}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to instantiate $configOB
again: it was already defined on line 1585. Also, the definition of $createCandidates
should go here instead of further up.
RETURN: (boolean) 1 if create_nii is set to Yes in the Config module, 0 otherwise | ||
|
||
=cut | ||
sub getCreateNii { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a good idea to have a private function getBoolean
that the other methods would call instead of "hardcoding" the logic inside each method. What do you think?
Oh and here's how you declare/used a private function:
my $privatePrintMethodRef = sub {
my($arg) = @_;
print "$arg.\n";
};
.
.
.
sub myPublicSayHelloMethod {
$myPrivatePrintMethodRef->('Hello');
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree!
@nicolasbrossard Thank you for the review! I integrated all your comments in the last commit. Please re-review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick but otherwise looks very good!
@nicolasbrossard Thank you! Your suggestions have been integrated in the last commit. Please re-review. |
Description
In this PR, all boolean Config options are queried using the
ConfigOB
instead of the function inDBI.pm
.This fixes partly