This cop checks for the use of the read_attribute or write_attribute methods.
@example
# bad x = read_attributed(:attr) write_attribute(:attr, val) # good x = self[:attr] self[:attr] = val
# File lib/rubocop/cop/rails/read_write_attribute.rb, line 29 def message(node) _receiver, method_name, *_args = *node if method_name == :read_attribute format(MSG, 'self[:attr]', 'read_attribute(:attr)') else format(MSG, 'self[:attr] = val', 'write_attribute(:attr, var)') end end
Generated with the Darkfish Rdoc Generator 2.