In c extensions for ruby, to call a method you can do
rb_funcall(object, rb_intern("method name"), argumentcount, arg1, arg2, โฆ);
where rb_intern () returns some internal representation of the method name. I saw some code that does instead
ID method; CONST_ID(method, "method name"); rb_funcall(object, method, argumentcount, arg1, arg2, โฆ);
What exactly is the difference between rb_intern () and CONST_ID. What are the benefits of CONST_ID ()?
source share