Method: ActiveSupport::SecureCompareRotator#secure_compare!

Defined in:
activesupport/lib/active_support/secure_compare_rotator.rb

#secure_compare!(other_value, on_rotation: @on_rotation) ⇒ Object



47
48
49
50
51
52
53
54
55
56
# File 'activesupport/lib/active_support/secure_compare_rotator.rb', line 47

def secure_compare!(other_value, on_rotation: @on_rotation)
  if secure_compare(@value, other_value)
    true
  elsif @rotate_values.any? { |value| secure_compare(value, other_value) }
    on_rotation&.call
    true
  else
    raise InvalidMatch
  end
end