Sha256: da5293c475e4cd8b683709ee36e947876f4467fcb75896ffbf481a576742d794

Contents?: true

Size: 723 Bytes

Versions: 39

Compression:

Stored size: 723 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module AST
    # A node extension for `send` nodes. This will be used in place of a plain
    # node when the builder constructs the AST, making its methods available
    # to all `send` nodes within RuboCop.
    class SendNode < Node
      include ParameterizedNode::RestArguments
      include MethodDispatchNode

      # @!method attribute_accessor?(node = self)
      def_node_matcher :attribute_accessor?, <<~PATTERN
        [(send nil? ${:attr_reader :attr_writer :attr_accessor :attr} $...)
         (_    _    _                                                 _ ...)]
      PATTERN

      private

      def first_argument_index
        2
      end
    end
  end
end

Version data entries

39 entries across 35 versions & 7 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.23.0/lib/rubocop/ast/node/send_node.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.23.0/lib/rubocop/ast/node/send_node.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.23.0/lib/rubocop/ast/node/send_node.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-ast-1.16.0/lib/rubocop/ast/node/send_node.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-ast-1.19.1/lib/rubocop/ast/node/send_node.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-ast-1.21.0/lib/rubocop/ast/node/send_node.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-ast-1.16.0/lib/rubocop/ast/node/send_node.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-ast-1.19.1/lib/rubocop/ast/node/send_node.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-ast-1.21.0/lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.24.0 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.23.0 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.22.0 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.21.0 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.20.1 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.20.0 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.19.1 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.19.0 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.18.0 lib/rubocop/ast/node/send_node.rb
rubocop-ast-1.17.0 lib/rubocop/ast/node/send_node.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/rubocop-ast-1.16.0/lib/rubocop/ast/node/send_node.rb