Method: Object#class

Defined in:
object.c

#classClass

Returns the class of obj. This method must always be called with an explicit receiver, as class is also a reserved word in Ruby.

1.class      #=> Fixnum
self.class   #=> Object

Returns:

[View source]

# File 'object.c'

/*
 *  call-seq:
 *     obj.class    -> class
 *
 *  Returns the class of <i>obj</i>. This method must always be
 *  called with an explicit receiver, as <code>class</code> is also a
 *  reserved word in Ruby.
 *
 *     1.class      #=> Fixnum
 *     self.class   #=> Object
 */

VALUE
rb_obj_class(VALUE obj)
{
    return rb_class_real(CLASS_OF(obj));
}