class RuboCop::AST::IndexasgnNode

if user ‘AST::Builder.modernize` or `AST::Builder.emit_index=true`
The main RuboCop runs in legacy mode; this node is only used
(sym :baz))
(sym :bar)
(send nil :foo) :[]=
(send
$ ruby-parse –legacy -e “foo = :baz”
(sym :baz))
(sym :bar)
(send nil :foo)
(indexasgn
$ ruby-parse -e “foo = :baz”
Not as thoroughly tested as legacy equivalent
Used for modern support only!

def assignment_method?

For similarity with legacy mode
def assignment_method?
  true
end

def attribute_accessor?

For similarity with legacy mode
def attribute_accessor?
  false
end

def first_argument_index

Returns:
  • (Array) - the arguments of the dispatched method
def first_argument_index
  1
end

def method_name

For similarity with legacy mode
def method_name
  :[]=
end