instance method
Class#allocate
() -> untyped
class.allocate() → obj
object.c
View on GitHub ↗
static VALUE
rb_class_alloc(VALUE klass)
{
rb_alloc_func_t allocator = class_get_alloc_func(klass);
return class_call_alloc_func(allocator, klass);
}
Allocates space for a new object of class’s class and does not call initialize on the new instance. The returned object must be an instance of class.
Example
klass = Class.new do def initialize(*args) @initialized = true end def initialized? @initialized || false end end klass.allocate.initialized? #=> false