public class FastXsService implements BasicLibraryService {
public boolean basicLoad(final Ruby runtime) throws IOException {
RubyModule string = runtime.getModule("String");
CallbackFactory fact = runtime.callbackFactory(FastXsService.class);
string.defineMethod("fast_xs",fact.getFastSingletonMethod("fast_xs"));
return true;
}
public static IRubyObject fast_xs(IRubyObject recv) {
String string = recv.convertToString().getUnicodeValue();