Sha256: f3f157c1c2d67c1502e295be96a645db942485bd61997fcde757ec910aff0703
Contents?: true
Size: 537 Bytes
Versions: 3
Compression:
Stored size: 537 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop module Style # 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. class AvoidClassVars < Cop MSG = 'Replace class var %s with a class instance var.' def on_cvasgn(node) class_var, = *node add_offence(:convention, node.loc.name, sprintf(MSG, class_var)) super end end end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
rubocop-0.9.1 | lib/rubocop/cop/style/avoid_class_vars.rb |
sabat-rubocop-0.9.0 | lib/rubocop/cop/style/avoid_class_vars.rb |
rubocop-0.9.0 | lib/rubocop/cop/style/avoid_class_vars.rb |