private static void callNormalMethodHook(RubyModule containingClass, ThreadContext context, RubySymbol name) { // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { callSingletonMethodHook(((MetaClass) containingClass).getAttached(), context, name); } else { containingClass.callMethod(context, "method_added", name); } }
private static void callNormalMethodHook(RubyModule containingClass, ThreadContext context, RubySymbol name) { // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { callSingletonMethodHook(((MetaClass) containingClass).getAttached(), context, name); } else { containingClass.callMethod(context, "method_added", name); } }
private static void callNormalMethodHook(RubyModule containingClass, ThreadContext context, RubySymbol name) { // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { callSingletonMethodHook(((MetaClass) containingClass).getAttached(), context, name); } else { containingClass.callMethod(context, "method_added", name); } }
private static void callNormalMethodHook(RubyModule containingClass, ThreadContext context, RubySymbol name) { // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { callSingletonMethodHook(((MetaClass) containingClass).getAttached(), context, name); } else { containingClass.callMethod(context, "method_added", name); } }
public static IRubyObject defs(ThreadContext context, IRubyObject self, IRubyObject receiver, Object scriptObject, String rubyName, String javaName, StaticScope scope, int arity, String filename, int line, CallConfiguration callConfig, String parameterDesc) { Class compiledClass = scriptObject.getClass(); Ruby runtime = context.runtime; RubyClass rubyClass = performSingletonMethodChecks(runtime, receiver, rubyName); MethodFactory factory = MethodFactory.createFactory(compiledClass.getClassLoader()); DynamicMethod method = constructSingletonMethod( factory, rubyName, javaName, rubyClass, new SimpleSourcePosition(filename, line), arity, scope, scriptObject, callConfig, parameterDesc); rubyClass.addMethod(rubyName, method); callSingletonMethodHook(receiver,context, runtime.fastNewSymbol(rubyName)); return runtime.getNil(); }
public static IRubyObject defs(ThreadContext context, IRubyObject self, IRubyObject receiver, Object scriptObject, String rubyName, String javaName, StaticScope scope, int arity, String filename, int line, CallConfiguration callConfig, String parameterDesc) { Class compiledClass = scriptObject.getClass(); Ruby runtime = context.runtime; RubyClass rubyClass = performSingletonMethodChecks(runtime, receiver, rubyName); MethodFactory factory = MethodFactory.createFactory(compiledClass.getClassLoader()); DynamicMethod method = constructSingletonMethod( factory, rubyName, javaName, rubyClass, new SimpleSourcePosition(filename, line), arity, scope, scriptObject, callConfig, parameterDesc); rubyClass.addMethod(rubyName, method); callSingletonMethodHook(receiver,context, runtime.fastNewSymbol(rubyName)); return runtime.getNil(); }