From: Edward Liu Date: 2008-01-12T04:48:38+09:00 Subject: Re: Using ruby.h to generate C++ vectors and maps I already know how to check if 'object' is an array or a hash. I am looking for how to translate 'object' from a Ruby array to a C/C++ vector or from a Ruby hash to a C/C++ map. Jason Roelofs wrote: > On Jan 11, 2008 2:12 PM, Edward Liu wrote: > >> is a macro called NUM2INT that converts a Ruby number into a C/C++ >> Posted via http://www.ruby-forum.com/. >> >> > You'll want something like: > > VALUE read_values(VALUE self, VALUE object) { > if(rb_obj_is_instance_of(object, "Hash") { > > } else if (rb_obj_is_instance_of(object, "Array") { > > } > } > > API is best found here: http://www.rubycentral.com/pickaxe/ext_ruby.html > > Jason -- Posted via http://www.ruby-forum.com/.