Sha256: b4014e2609a55a7b09447f604e56399c6ac7f462bb1c2c10c3067e0fa88f6d20

Contents?: true

Size: 472 Bytes

Versions: 3

Compression:

Stored size: 472 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Style
      # This cop checks for uses of the case equality operator(===).
      class CaseEquality < Cop
        MSG = 'Avoid the use of the case equality operator(===).'

        def on_send(node)
          _receiver, method_name, *_args = *node

          if method_name == :===
            add_offence(:convention, node.loc.selector, MSG)
          end

          super
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
rubocop-0.9.1 lib/rubocop/cop/style/case_equality.rb
sabat-rubocop-0.9.0 lib/rubocop/cop/style/case_equality.rb
rubocop-0.9.0 lib/rubocop/cop/style/case_equality.rb