How to create classes automatically

hi

let's say I have a string with a class name as a value.
I want to create a new instance of the class with the given class name.

example:
when I have a string like this:

str = "Array"

I want to create a new Array class base on the information in str.

any ideas how this could be done ?

thanks a lot

Markus

Object.const_get("Array").new

···

On 8/3/06, markusjais@gmx.de <markusjais@gmx.de> wrote:

hi

let's say I have a string with a class name as a value.
I want to create a new instance of the class with the given class name.

example:
when I have a string like this:

str = "Array"

I want to create a new Array class base on the information in str.

any ideas how this could be done ?

thanks a lot

Markus

str = "Array"
Object.const_get(str).new

···

On 8/3/06, markusjais@gmx.de <markusjais@gmx.de> wrote:

I want to create a new Array class base on the information in str.
any ideas how this could be done ?

thank you very much.

Markus

Chris Roos wrote:

···

Object.const_get("Array").new

On 8/3/06, markusjais@gmx.de <markusjais@gmx.de> wrote:

hi

let's say I have a string with a class name as a value.
I want to create a new instance of the class with the given class name.

example:
when I have a string like this:

str = "Array"

I want to create a new Array class base on the information in str.

any ideas how this could be done ?

thanks a lot

Markus