Skip to content

Commit

Permalink
rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ozayr-zaviar committed Nov 16, 2021
1 parent d2f1975 commit cb3db8b
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lib/optimizely/optimizely_user_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ def decide_all(options = nil)
# @return - true if the forced decision has been set successfully.

def set_forced_decision(context, decision)
unless @optimizely_client&.is_valid
return false
end
return false unless @optimizely_client&.is_valid

flag_key = context[:flag_key]
return false if flag_key.nil?

Expand All @@ -128,9 +127,7 @@ def find_forced_decision(context)
# @return - A variation key or nil if forced decisions are not set for the parameters.

def get_forced_decision(context)
unless @optimizely_client&.is_valid
return nil
end
return nil unless @optimizely_client&.is_valid

find_forced_decision(context)
end
Expand All @@ -142,9 +139,7 @@ def get_forced_decision(context)
# @return - true if the forced decision has been removed successfully.

def remove_forced_decision(context)
unless @optimizely_client&.is_valid
return false
end
return false unless @optimizely_client&.is_valid

deleted = false
@forced_decision_mutex.synchronize do
Expand All @@ -161,9 +156,7 @@ def remove_forced_decision(context)
# @return - true if forced decisions have been removed successfully.

def remove_all_forced_decision
unless @optimizely_client&.is_valid
return false
end
return false unless @optimizely_client&.is_valid

@forced_decision_mutex.synchronize { @forced_decisions.clear }
true
Expand Down

0 comments on commit cb3db8b

Please sign in to comment.