class RuboCop::Cop::Style::CaseEquality

If ‘AllowOnSelfClass` option is enabled, the cop will ignore violations when the receiver of the case equality operator is `self.class`. Note intermediate variables are not accepted.

@example

# bad
(1..100) === 7
/something/ === some_string

# good
something.is_a?(Array)
(1..100).include?(7)
/something/.match?(some_string)

@example AllowOnConstant: false (default)

# bad
Array === something

@example AllowOnConstant: true

# good
Array === something

@example AllowOnSelfClass: false (default)

# bad
self.class === something

@example AllowOnSelfClass: true

# good
self.class === something