mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix for :instance_reader => false code example
This commit is contained in:
parent
41d179b7d6
commit
28e32598b9
1 changed files with 1 additions and 1 deletions
|
@ -1020,7 +1020,7 @@ class A
|
|||
class_attribute :x, :instance_reader => false
|
||||
end
|
||||
|
||||
A.x = 1 # NoMethodError
|
||||
A.new.x = 1 # NoMethodError
|
||||
</ruby>
|
||||
|
||||
For convenience +class_attribute+ also defines an instance predicate which is the double negation of what the instance reader returns. In the examples above it would be called +x?+.
|
||||
|
|
Loading…
Reference in a new issue