Sha256: cc6e4aa63af1acdd1fcc7a3cacbd2e974466721d0cbfb9bf6acbce0442e88b65
Contents?: true
Size: 504 Bytes
Versions: 2
Compression:
Stored size: 504 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop module Style # This cop checks for uses of Module#attr. class Attr < Cop MSG = 'Do not use `attr`. Use `attr_reader` instead.' def on_send(node) convention(node, :selector) if command?(:attr, node) end def autocorrect_action(node) @corrections << lambda do |corrector| corrector.replace(node.loc.selector, 'attr_reader') end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.13.1 | lib/rubocop/cop/style/attr.rb |
rubocop-0.13.0 | lib/rubocop/cop/style/attr.rb |