Sha256: 673e94b3a856ab0fc1650b20815db439559f19e1984ae76b15c2815bfde19ba3

Contents?: true

Size: 546 Bytes

Versions: 5

Compression:

Stored size: 546 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 ClassVars < Cop
        MSG = 'Replace class var %s with a class instance var.'

        def on_cvasgn(node)
          convention(node, :name)
        end

        def message(node)
          class_var, = *node
          MSG.format(class_var)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-0.15.0 lib/rubocop/cop/style/class_vars.rb
rubocop-0.14.1 lib/rubocop/cop/style/class_vars.rb
rubocop-0.14.0 lib/rubocop/cop/style/class_vars.rb
rubocop-0.13.1 lib/rubocop/cop/style/class_vars.rb
rubocop-0.13.0 lib/rubocop/cop/style/class_vars.rb