Class: RuboCop::Cop::Lint::UselessAssignment

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/lint/useless_assignment.rb

Constant Summary collapse

YAYOI_MSG =
"ζ*'ヮ')ζ<うっうー!使っていない変数がありますよー! - `%<variable>s`.".freeze

Instance Method Summary collapse

Methods inherited from Cop

#message

Instance Method Details

#message_for_useless_assignment(assignment) ⇒ Object



9
10
11
12
13
14
# File 'lib/rubocop/cop/lint/useless_assignment.rb', line 9

def message_for_useless_assignment(assignment)
  variable = assignment.variable

  format(YAYOI_MSG, variable: variable.name) +
    message_specification(assignment, variable).to_s
end