S
sayoyo
Hi,
I wish to know what is the difference beteen rb_define_singleton_method
and rb_define_method???
I'm using rails-postgres and I need to access to a class defined in
postgres.so (I'm runing on Linux), the class name is PGconn. I find out
if the method which is defined with rb_define_singleton_method, the
ruby class PGconn will able to use but if the method is defined with
rb_define_method, the ruby class PGconn will not able to see it as a
method!!!! Ex:
rb_define_singleton_method(rb_cPGconn, "connect", pgconn_s_connect,
-1); # able to use
rb_define_method(rb_cPGconn, "close", pgconn_close, 0); # unable to see
Can anyone tell me why???
Thanks you very much
Sayoyo
I wish to know what is the difference beteen rb_define_singleton_method
and rb_define_method???
I'm using rails-postgres and I need to access to a class defined in
postgres.so (I'm runing on Linux), the class name is PGconn. I find out
if the method which is defined with rb_define_singleton_method, the
ruby class PGconn will able to use but if the method is defined with
rb_define_method, the ruby class PGconn will not able to see it as a
method!!!! Ex:
rb_define_singleton_method(rb_cPGconn, "connect", pgconn_s_connect,
-1); # able to use
rb_define_method(rb_cPGconn, "close", pgconn_close, 0); # unable to see
Can anyone tell me why???
Thanks you very much
Sayoyo