diff options
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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 * */ |