Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
gardleopard committed Oct 16, 2023
1 parent 036a8a1 commit 7bdbe31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Expand Up @@ -13,6 +13,8 @@ Metrics/ClassLength:
Max: 135
CountAsOne:
- 'method_call'
Exclude:
- 'lib/unleash/feature_toggle.rb'
Layout/LineLength:
Max: 140
Metrics/MethodLength:
Expand Down
9 changes: 4 additions & 5 deletions lib/unleash/feature_toggle.rb
Expand Up @@ -92,15 +92,14 @@ def evaluate_parenthood(parent, context)
return false unless parent_toggle.dependencies.empty?

evaluation_result = parent_toggle.is_enabled?(context)
if parent["enabled"] == false
return !evaluation_result
else
return false unless evaluation_result
end
return !evaluation_result if parent["enabled"] == false

return false unless evaluation_result

unless parent["variants"].nil? || parent["variants"].empty?
return parent["variants"].include?(parent_toggle.get_variant(context).name)
end

evaluation_result
end

Expand Down

0 comments on commit 7bdbe31

Please sign in to comment.