method
singleton_class
ruby latest stable - Class:
Object
singleton_class()public
Returns the singleton class of obj. This method creates a new singleton class if obj does not have one.
If obj is nil, true, or false, it returns NilClass, TrueClass, or FalseClass, respectively. If obj is an Integer, a Float or a Symbol, it raises a TypeError.
Object .new .singleton_class #=> #<Class:#<Object:0xb7ce1e24>> String .singleton_class #=> #<Class:String> nil.singleton_class #=> NilClass
static VALUE
rb_obj_singleton_class(VALUE obj)
{
return rb_singleton_class(obj);
}