Class: Class

Inherits:
Object show all
Defined in:
lib/include/class.rb

Instance Method Summary collapse

Instance Method Details

#to_moduleObject Also known as: to_m



2
3
4
5
6
7
8
9
10
# File 'lib/include/class.rb', line 2

def to_module
  result = self.clone
  o = RubyInternal::RObject.new(result.internal_ptr)
  o.flags &= ~ RubyInternal::FL_SINGLETON
  o.flags &= ~ RubyInternal::T_MASK
  o.flags |= RubyInternal::T_MODULE
  o.klass = Module.internal_ptr.to_i
  return result
end