From d66a3fe8c0b5977c8c7bbff878b549fb4f01a95c Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Wed, 15 Jun 2016 20:35:16 -0700 Subject: [ci skip] When instance_reader is false, attribute can still be assigned by the instance objects --- guides/source/active_support_core_extensions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 565c87c4b5..e0b6f2f820 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -954,7 +954,8 @@ class A class_attribute :x, instance_reader: false end -A.new.x = 1 # NoMethodError +A.new.x = 1 +A.new.x # NoMethodError ``` 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?`. -- cgit v1.2.3