Issue #15249 has been reported by CaryInVictoria (Cary Swoveland).

----------------------------------------
Misc #15249: Documentation for attr_accessor and attr_reader should be corrected
https://bugs.ruby-lang.org/issues/15249

* Author: CaryInVictoria (Cary Swoveland)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The documentation for [Module#attr_accessor](http://ruby-doc.org/core-2.5.1/Module.html#method-i-attr_accessor) (v2.5.1) begins, "Defines a named attribute for this module, where the name is symbol.id2name, creating an instance variable (@name) and...". Similarly, the documentation for [Module#attr_reader](http://ruby-doc.org/core-2.5.1/Module.html#method-i-attr_reader) states, "Creates instance variables and...". These statements do not appear to be correct:

    class C
      attr_accessor :dog
      attr_reader :cat
    end
    C.new.instance_variables #=> []





-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>