Sha256: ba48cf9fafa71958557f6080ba48b8b6cc7aa0d84551ea5de9a24e2be31b781e

Contents?: true

Size: 655 Bytes

Versions: 33

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Style
      # This cop checks for the use of the send method.
      #
      # @example
      #   # bad
      #   Foo.send(:bar)
      #   quuz.send(:fred)
      #
      #   # good
      #   Foo.__send__(:bar)
      #   quuz.public_send(:fred)
      class Send < Base
        MSG = 'Prefer `Object#__send__` or `Object#public_send` to ' \
              '`send`.'
        RESTRICT_ON_SEND = %i[send].freeze

        def on_send(node)
          return unless node.arguments?

          add_offense(node.loc.selector)
        end
        alias on_csend on_send
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/style/send.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/style/send.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/style/send.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/style/send.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/style/send.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/style/send.rb
rubocop-1.12.1 lib/rubocop/cop/style/send.rb
rubocop-1.12.0 lib/rubocop/cop/style/send.rb
rubocop-1.11.0 lib/rubocop/cop/style/send.rb
rubocop-1.10.0 lib/rubocop/cop/style/send.rb
rubocop-1.9.1 lib/rubocop/cop/style/send.rb
rubocop-1.9.0 lib/rubocop/cop/style/send.rb
rubocop-1.8.1 lib/rubocop/cop/style/send.rb
rubocop-1.8.0 lib/rubocop/cop/style/send.rb
rubocop-1.7.0 lib/rubocop/cop/style/send.rb
rubocop-1.6.1 lib/rubocop/cop/style/send.rb
rubocop-1.6.0 lib/rubocop/cop/style/send.rb
rubocop-1.5.2 lib/rubocop/cop/style/send.rb
rubocop-1.5.1 lib/rubocop/cop/style/send.rb
rubocop-1.5.0 lib/rubocop/cop/style/send.rb