-
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
Changes from 2 commits
616213e
307a996
952ee31
80f6f50
431a698
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,10 @@ use constant LOOK_UP_CENTER_NAME_USING => 'lookupCenterNameUsing'; | |
use constant DEFACING_REF_SCAN_TYPE => 'reference_scan_type_for_defacing'; | ||
use constant LEGO_PHANTOM_REGEX => 'LegoPhantomRegex'; | ||
use constant LIVING_PHANTOM_REGEX => 'LivingPhantomRegex'; | ||
use constant CREATE_NII => 'create_nii'; | ||
use constant HORIZONTAL_PICS => 'horizontalPics'; | ||
use constant IS_QSUB => 'is_qsub'; | ||
use constant CREATE_CANDIDATES => 'createCandidates'; | ||
|
||
=pod | ||
|
||
|
@@ -348,6 +352,66 @@ sub getLivingPhantomRegex { | |
return &$getConfigSettingRef($self, LIVING_PHANTOM_REGEX); | ||
} | ||
|
||
=head3 getCreateNii() | ||
|
||
Get the create_nii Config setting. | ||
|
||
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 commentThe 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 Oh and here's how you declare/used a private function:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree! |
||
my $self = shift; | ||
|
||
my $value = &$getConfigSettingRef($self, CREATE_NII); | ||
|
||
return ($value eq "true" || $value == 1) ? 1 : 0; | ||
} | ||
|
||
=head3 getHorizontalPics() | ||
|
||
Get the horizontalPics Config setting. | ||
|
||
RETURN: (boolean) 1 if horizontalPics is set to Yes in the Config module, 0 otherwise | ||
|
||
=cut | ||
sub getHorizontalPics { | ||
my $self = shift; | ||
|
||
my $value = &$getConfigSettingRef($self, HORIZONTAL_PICS); | ||
|
||
return ($value eq "true" || $value == 1) ? 1 : 0; | ||
} | ||
|
||
=head3 getIsQsub() | ||
|
||
Get the is_qsub Config setting. | ||
|
||
RETURN: (boolean) 1 if is_qsub is set to Yes in the Config module, 0 otherwise | ||
|
||
=cut | ||
sub getIsQsub { | ||
my $self = shift; | ||
|
||
my $value = &$getConfigSettingRef($self, IS_QSUB); | ||
|
||
return ($value eq "true" || $value == 1) ? 1 : 0; | ||
} | ||
|
||
=head3 getCreateCandidates() | ||
|
||
Get the createCandidates Config setting. | ||
|
||
RETURN: (boolean) 1 if createCandidates is set to Yes in the Config module, 0 otherwise | ||
|
||
=cut | ||
sub getCreateCandidates { | ||
my $self = shift; | ||
|
||
my $value = &$getConfigSettingRef($self, IS_QSUB); | ||
|
||
return ($value eq "true" || $value == 1) ? 1 : 0; | ||
} | ||
|
||
1; | ||
|
||
|
||
|
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.