Sha256: 36201ee7a96ad07240bfd5a27fade4b7f3810781c0d075f5b54a0e510a8338f9
Contents?: true
Size: 636 Bytes
Versions: 38
Compression:
Stored size: 636 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
38 entries across 38 versions & 6 rubygems