我的代码中有以下几行test_func.rb
require 'inline'
class TestFunc
inline do |builder|
builder.c '
int testfunc() {
return 0;
}'
end
end
我只能从对象而不是类中调用该函数。
我可以称之为,
obj = TestFunc.new
obj.testfunc()
但是我应该如何声明以便我可以调用,
TestFunc.testfunc()