Project

General

Profile

Actions

Misc #15249

open

Documentation for attr_accessor and attr_reader should be corrected

Added by CaryInVictoria (Cary Swoveland) over 5 years ago.

Status:
Open
Assignee:
-
[ruby-core:89540]

Description

The documentation for Module#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 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 #=> []

No data to display

Actions

Also available in: Atom PDF

Like0