Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix for :instance_reader => false code example

  • Loading branch information...
commit 28e32598b9a99a2e5794e1ee8882ca42746ae513 1 parent 41d179b
@alindeman alindeman authored
View
2  railties/guides/source/active_support_core_extensions.textile
@@ -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?+.
Please sign in to comment.
Something went wrong with that request. Please try again.