Sha256: c25b262d65c9021e4eddc82d7a6a8a9722fb65472d68d6f33d0706ea8f9487a0
Contents?: true
Size: 1.09 KB
Versions: 202
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true module RuboCop module AST # Used for modern support only! # Not as thoroughly tested as legacy equivalent # # $ ruby-parse -e "foo[:bar]" # (index # (send nil :foo) # (sym :bar)) # $ ruby-parse --legacy -e "foo[:bar]" # (send # (send nil :foo) :[] # (sym :bar)) # # The main RuboCop runs in legacy mode; this node is only used # if user `AST::Builder.modernize` or `AST::Builder.emit_index=true` class IndexNode < Node include ParameterizedNode::RestArguments include MethodDispatchNode # For similarity with legacy mode def attribute_accessor? false end # For similarity with legacy mode def assignment_method? false end # For similarity with legacy mode def method_name :[] end private # An array containing the arguments of the dispatched method. # # @return [Array<Node>] the arguments of the dispatched method def first_argument_index 1 end end end end
Version data entries
202 entries across 196 versions & 26 rubygems