From: 7stud -- Date: 2011-07-22T13:13:50+09:00 Subject: Re: create object by reflection class Person attr_accessor :name, :surname def initialize(name,surname) @name = name @surname = surname end end def build(instance,clazz,args) @instances = {} if args == nil @instances[instance] = Object.const_get(clazz).new else @instances[instance] = Object.const_get(clazz).new(*args) puts "#{@instances[instance].name} #{@instances[instance].surname}" end end build "int0","Person",["name", "surname"] --output:-- name surname -- Posted via http://www.ruby-forum.com/.