I'm writing a Ruby binding to a C library. I want to remove the new
method from some of my classes - I'm creating objects with other class methods like create
and load
and the default implementation of new
just leaves me with an invalid pointer (the objects of the class are just pointers to opaque structs).
I've read this but
class Test
end
class <<Test
remove_method :new
end
Just gave me
NameError: method `new' not defined in Class
And anyways I want to do it from C (and avoid rb_eval_string
).