Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

ObjectSpace::InternalObjectWrapper#type

type → symbol

Returns the type of the wrapped internal object as a symbol.

For example, an included module is represented internally as a T_ICLASS object:

Example
require 'objspace'

module M; end
class A; include M; end

iclass = ObjectSpace.internal_super_of(A)
iclass.type # => :T_ICLASS

The exact set of returned symbols is implementation specific.

See also #internal_object_id #inspect also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0