Hi all,
Ruby 1.8.2
In pure Ruby I can do this:
class File
TStruct = Struct.new("TStruct",:bar,:baz)
end
t = File::TStruct.new("hello","world")
How do I achieve the equivalent from within a C extension? I have
this:
void Init_file(){
VALUE tStruct = rb_struct_define("TStruct","bar","baz",0);
}
I am unable to access this from within Ruby, however. I also tried
declaring it as "File::TStruct", but Ruby complained with a NameError.
So, how do I declare a struct "under" a specific class?
Regards,
Dan