Sha256: 482a57b844bc6720f27c7e2ab67991286c6a2ac9ce5f28bea540fceaf13a5715
Contents?: true
Size: 561 Bytes
Versions: 3
Compression:
Stored size: 561 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop module Style # This cop checks for uses of the class/module name instead of # self, when defining class/module methods. class ClassMethods < Cop MSG = 'Prefer self over class/module for class/module methods.' # TODO - check if we're in a class/module def on_defs(node) definee, _name, _args, _body = *node if definee.type == :const add_offence(:convention, definee.loc.name, MSG) end 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/class_methods.rb |
sabat-rubocop-0.9.0 | lib/rubocop/cop/style/class_methods.rb |
rubocop-0.9.0 | lib/rubocop/cop/style/class_methods.rb |