Eyal Oren a écrit :
> On 08/19/07/08/07 12:32 +0200, Damaris Fuentes wrote:
>> Hi all,
>> I'm trying to create an instance of a class, but
I don't know this
>> class beforehand. So I have the namespace (let's
say, ":foaf"), and a
>> variable with the class localname. I can obtain the
complete uri with
>> class_uri = Namespace.lookup(:foaf, my_var), but I
don't really know
>> how to make an instance with this ( and my_instance
=
>> class_uri.new.... does not work )
> Use Ruby's 'send' method:
> my_instance = class_uri.send(:new, 'uri...')
The above code doesn't work for me ? This does:
ObjectManager.construct_class(class_uri).new...
-- Yoan
>
> -eyal
> _______________________________________________
> ActiveRDF mailing list
> ActiveRDF lists.deri.org
> http
://lists.deri.org/mailman/listinfo/activerdf
_______________________________________________
ActiveRDF mailing list
ActiveRDF lists.deri.org
http
://lists.deri.org/mailman/listinfo/activerdf
|