Sha256: 71e3f5544e4babcd7ad403d4d6fb794f5914be9a254c50da6bc639617e1bb9eb

Contents?: true

Size: 375 Bytes

Versions: 3

Compression:

Stored size: 375 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)
          if command?(:attr, node)
            add_offence(:convention, node.loc.selector, MSG)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubocop-0.11.1 lib/rubocop/cop/style/attr.rb
rubocop-0.11.0 lib/rubocop/cop/style/attr.rb
rubocop-0.10.0 lib/rubocop/cop/style/attr.rb