class Rubocop::Cop::Style::AvoidClassVars

This cop checks for uses of class variables. Offences are signaled only on assignment to class variables to reduced the number of offences that would be reported.

Constants

MSG

Public Instance Methods

on_cvasgn(node) click to toggle source
Calls superclass method
# File lib/rubocop/cop/style/avoid_class_vars.rb, line 12
def on_cvasgn(node)
  class_var, = *node
  add_offence(:convention, node.loc.name, sprintf(MSG, class_var))
  super
end