1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
# 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
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
|