Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for :instance_reader => false code example

  • Loading branch information...
commit b9c66fa0aa6e4726b84eb1c4a0ca014a777640cf 1 parent 04767d1
@alindeman alindeman authored vijaydev committed
View
2  railties/guides/source/active_support_core_extensions.textile
@@ -1016,7 +1016,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?+.
Please sign in to comment.
Something went wrong with that request. Please try again.