on_send

in lib/rubocop/cop/primer/deprecated_arguments.rb [269:291]


        def on_send(node)
          return unless valid_node?(node)
          return unless node.arguments?

          
          kwargs = node.arguments.last

          return unless kwargs.type == :hash

          kwargs.pairs.each do |pair|
            
            next if pair.key.type != :sym
            next unless pair.value.type == :sym || pair.value.type == :str

            key = pair.key.value
            value = pair.value.value.to_sym

            next unless DEPRECATED.key?(key) && DEPRECATED[key].key?(value)

            add_offense(pair, message: INVALID_MESSAGE)
          end
        end