summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/object.c b/object.c
index 813518676f..3b6b8385f2 100644
--- a/object.c
+++ b/object.c
@@ -1573,8 +1573,21 @@ rb_class_initialize(argc, argv, klass)
* call-seq:
* class.allocate() => obj
*
- * Allocates space for a new object of <i>class</i>'s class. The
- * returned object must be an instance of <i>class</i>.
+ * Allocates space for a new object of <i>class</i>'s class and does not
+ * call initialize on the new instance. The returned object must be an
+ * instance of <i>class</i>.
+ *
+ * klass = Class.new do
+ * def initialize(*args)
+ * @initialized = true
+ * end
+ *
+ * def initialized?
+ * @initialized || false
+ * end
+ * end
+ *
+ * klass.allocate.initialized? #=> false
*
*/