Class: RuboCop::Cop::Kata::NoRedundantVariable

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
RangeHelp
Defined in:
lib/rubocop/cop/kata/no_redundant_variable.rb

Overview

SPDX-FileCopyrightText: Copyright (c) 2019-2026 Yegor Bugayenko SPDX-License-Identifier: MIT Derived from rubocop-elegant (https://github.com/yegor256/rubocop-elegant), see LICENSE.txt

Constant Summary collapse

MSG =
'Variable "%s" is redundant and must be inlined: it is read only once'

Instance Method Summary collapse

Instance Method Details

#on_def(node) ⇒ Object



13
# File 'lib/rubocop/cop/kata/no_redundant_variable.rb', line 13

def on_def(node) = check(node.body)

#on_defs(node) ⇒ Object



15
# File 'lib/rubocop/cop/kata/no_redundant_variable.rb', line 15

def on_defs(node) = check(node.body)