Class: RuboCop::Cop::Elegant::GoodVariableName

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/elegant/good_variable_name.rb

Overview

SPDX-FileCopyrightText: Copyright © 2019-2026 Yegor Bugayenko SPDX-License-Identifier: MIT

Constant Summary collapse

MSG =
'Variable name "%<name>s" does not match the required pattern'

Instance Method Summary collapse

Instance Method Details

#on_cvasgn(node) ⇒ Object



18
19
20
# File 'lib/rubocop/cop/elegant/good_variable_name.rb', line 18

def on_cvasgn(node)
  check(node, node.children.first.to_s)
end

#on_gvasgn(node) ⇒ Object



22
23
24
# File 'lib/rubocop/cop/elegant/good_variable_name.rb', line 22

def on_gvasgn(node)
  check(node, node.children.first.to_s)
end

#on_ivasgn(node) ⇒ Object



14
15
16
# File 'lib/rubocop/cop/elegant/good_variable_name.rb', line 14

def on_ivasgn(node)
  check(node, node.children.first.to_s)
end

#on_lvasgn(node) ⇒ Object



10
11
12
# File 'lib/rubocop/cop/elegant/good_variable_name.rb', line 10

def on_lvasgn(node)
  check(node, node.children.first.to_s)
end