Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::CheckAssignment

Common functionality for checking assignment nodes.

Constants

TYPES

Public Instance Methods

on_casgn(node) click to toggle source
# File lib/rubocop/cop/mixin/check_assignment.rb, line 14
def on_casgn(node)
  _scope, _lhs, rhs = *node
  check_assignment(node, rhs)
end
on_op_asgn(node) click to toggle source
# File lib/rubocop/cop/mixin/check_assignment.rb, line 19
def on_op_asgn(node)
  _lhs, _op, rhs = *node
  check_assignment(node, rhs)
end
on_send(node) click to toggle source
# File lib/rubocop/cop/mixin/check_assignment.rb, line 24
def on_send(node)
  _receiver, method_name, *_, rhs = *node

  # we only want to indent relative to the receiver
  # when the method called looks like a setter
  return unless method_name.to_s.end_with?('=')

  # This will match if, case, begin, blocks, etc.
  check_assignment(node, rhs) if rhs.is_a?(AST::Node)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.