public
Description: Convert Classes and Objects to Modules so they can be extended/included.
Homepage:
Clone URL: git://github.com/banister/object2module.git
name age message
file LICENSE Loading commit data...
file README.rdoc Thu Sep 24 23:40:05 -0700 2009 pure c version [banister]
file Rakefile Thu Sep 24 23:40:05 -0700 2009 pure c version [banister]
directory ext/
directory lib/
directory pkg/ Fri Sep 25 00:24:25 -0700 2009 new gem [banister]
directory test/ Thu Sep 24 23:40:05 -0700 2009 pure c version [banister]
README.rdoc

# Object2module

  • converts a Class (or the Singleton of an Object) to a Module
  • Includes gen_extend and gen_include methods: generalizations of Object#extend and Module#include that work with Objects and Classes as well as Modules

How it works:

  • First creates an IClass for the Class in question and sets the T_MODULE flag
  • Recursively converts superclasses of the Class to IClasses creating a modulified version of the Class’s inheritance chain
  • gen_include/gen_extend automatically call #to_module on the Class/Object before inclusion/extension.