Sha256: 2f5dd0bd553f562e00b13176c310cb8a3c8a7d3f74aed8b9b70464cbeafd294a
Contents?: true
Size: 1.07 KB
Versions: 2
Compression:
Stored size: 1.07 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 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 # An array containing the arguments of the dispatched method. # # @return [Array<Node>] the arguments of the dispatched method def arguments node_parts[1..-1] end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubocop-ast-0.2.0 | lib/rubocop/ast/node/index_node.rb |
rubocop-ast-0.1.0 | lib/rubocop/ast/node/index_node.rb |