B
Brian Palmer
Another C extension question for the experts: in a C ruby class, I'm
trying to use the Singleton standard library. It doesn't work, though
no errors are thrown.
ruby_rpg_class = rb_define_class("RPGEngine", rb_cObject);
rb_require("singleton");
rb_include_module(ruby_rpg_class, rb_const_get(rb_cObject,
rb_intern("Singleton")));
With this C code above, I can still call RPGEngine.new and get a new
instance of the class. RPGEngine.instance throws a NoMethodError.
Is the code above correct?
Thanks again,
-- Brian
trying to use the Singleton standard library. It doesn't work, though
no errors are thrown.
ruby_rpg_class = rb_define_class("RPGEngine", rb_cObject);
rb_require("singleton");
rb_include_module(ruby_rpg_class, rb_const_get(rb_cObject,
rb_intern("Singleton")));
With this C code above, I can still call RPGEngine.new and get a new
instance of the class. RPGEngine.instance throws a NoMethodError.
Is the code above correct?
Thanks again,
-- Brian