Hi,

In Python I can do this:

 >>> def create_class(name):
...     import new
...     c = new.classobj(name, tuple([object]), {})
...     def __init__(self, value):
...         self.value = value
...     setattr(c, "__init__", new.instancemethod(__init__, None, c))
...     return c
...
 >>> MyClass = create_class("MyClass")
 >>>
 >>> obj = MyClass(value=10)
 >>> print obj.value
10

Is there anything similar in Ruby? Or do I need to use eval()?



--Jonas Galvez