J
Jonas Galvez
Hi,
In Python I can do this:
... 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
...10
Is there anything similar in Ruby? Or do I need to use eval()?
--Jonas Galvez
In Python I can do this:
... 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
...10
Is there anything similar in Ruby? Or do I need to use eval()?
--Jonas Galvez