Refine search
@JRubyMethod public IRubyObject keys(ThreadContext context) { return RubyArray.newArray(context.runtime, table.keySet()); }
@JRubyMethod public IRubyObject values(ThreadContext context) { return RubyArray.newArray(context.runtime, table.values()); }
@JRubyMethod public final IRubyObject param_types(ThreadContext context) { return RubyArray.newArray(context.runtime, parameterTypes); } }
@JRubyMethod public final IRubyObject param_types(ThreadContext context) { return RubyArray.newArray(context.runtime, parameterTypes); } }
@JRubyMethod public final IRubyObject param_types(ThreadContext context) { return RubyArray.newArray(context.runtime, parameterTypes); } }
@JRubyMethod public static IRubyObject declared_instance_methods(final ThreadContext context, final IRubyObject self) { final java.lang.Class klass = unwrapJavaObject(self); final RubyArray methods = RubyArray.newArray(context.runtime); for ( java.lang.reflect.Method method : klass.getDeclaredMethods() ) { if ( ! Modifier.isStatic(method.getModifiers()) ) methods.add(method); } return methods; }
@JRubyMethod public static IRubyObject declared_class_methods(final ThreadContext context, final IRubyObject self) { final java.lang.Class klass = unwrapJavaObject(self); final RubyArray methods = RubyArray.newArray(context.runtime); for ( java.lang.reflect.Method method : klass.getDeclaredMethods() ) { if ( Modifier.isStatic(method.getModifiers()) ) methods.add(method); } return methods; }
@JRubyMethod public static IRubyObject java_class_methods(final ThreadContext context, final IRubyObject self) { final java.lang.Class klass = unwrapJavaObject(self); final RubyArray methods = RubyArray.newArray(context.runtime); for ( java.lang.reflect.Method method : klass.getMethods() ) { if ( Modifier.isStatic(method.getModifiers()) ) methods.add(method); } return methods; }
@JRubyMethod public static IRubyObject java_instance_methods(final ThreadContext context, final IRubyObject self) { final java.lang.Class klass = unwrapJavaObject(self); final RubyArray methods = RubyArray.newArray(context.runtime); for ( java.lang.reflect.Method method : klass.getMethods() ) { if ( ! Modifier.isStatic(method.getModifiers()) ) methods.add(method); } return methods; }
@JRubyMethod public static IRubyObject java_instance_methods(final ThreadContext context, final IRubyObject self) { final java.lang.Class klass = unwrapJavaObject(self); final RubyArray methods = RubyArray.newArray(context.runtime); for ( java.lang.reflect.Method method : klass.getMethods() ) { if ( ! Modifier.isStatic(method.getModifiers()) ) methods.add(method); } return methods; }
@JRubyMethod(name = "thread_variables") public synchronized IRubyObject thread_variables(ThreadContext context) { Map<IRubyObject, IRubyObject> vars = getThreadLocals(); RubyArray ary = RubyArray.newArray(context.runtime, vars.size()); for (Map.Entry<IRubyObject, IRubyObject> entry : vars.entrySet()) { ary.append(entry.getKey()); } return ary; }
@JRubyMethod(name = "thread_variables") public synchronized IRubyObject thread_variables(ThreadContext context) { Map<IRubyObject, IRubyObject> vars = getThreadLocals(); RubyArray ary = RubyArray.newArray(context.runtime, vars.size()); for (Map.Entry<IRubyObject, IRubyObject> entry : vars.entrySet()) { ary.append(entry.getKey()); } return ary; }
@JRubyMethod public IRubyObject ip_unpack(ThreadContext context) { byte[] bytes = inetAddress.getAddress(); RubyArray ary = RubyArray.newArray(context.runtime, bytes.length); for (byte bite : bytes) ary.append(context.runtime.newFixnum(bite)); return ary; }
@JRubyMethod public IRubyObject list(Block block) { RubyArray ary = RubyArray.newArray(getRuntime()); synchronized (rubyThreadList) { for (RubyThread thread : rubyThreadList) { if (thread != null) { ary.append(thread); } } } return ary; }
@JRubyMethod(name = "<<", rest = true) public IRubyObject op_lshift(ThreadContext context, IRubyObject[]args) { if (args.length == 1 && args[0] instanceof RubyArray && ((RubyArray) args[0]).getLength() == 1) args[0] = RubyArray.newArray(context.runtime, args[0]); yield(context, args); return this; } }
@JRubyMethod(name = "<<", rest = true) public IRubyObject op_lshift(ThreadContext context, IRubyObject[]args) { if (args.length == 1 && args[0] instanceof RubyArray && ((RubyArray) args[0]).getLength() == 1) args[0] = RubyArray.newArray(context.runtime, args[0]); yield(context, args); return this; } }
/** num_divmod * */ @JRubyMethod(name = "divmod") public IRubyObject divmod(ThreadContext context, IRubyObject other) { return RubyArray.newArray(context.runtime, div(context, other), modulo(context, other)); }
@JRubyMethod public IRubyObject list(Block block) { RubyArray ary = RubyArray.newArray(getRuntime()); synchronized (ary) { for (RubyThread thread : rubyThreadList) { if (thread != null) { ary.append(thread); } } return ary; } }
@JRubyMethod public IRubyObject precs(ThreadContext context) { return RubyArray.newArray(context.runtime, context.runtime.newFixnum(getSignificantDigits().length()), context.runtime.newFixnum(((getAllDigits().length() / 4) + 1) * 4)); }
@JRubyMethod public IRubyObject precs(ThreadContext context) { return RubyArray.newArray(context.runtime, context.runtime.newFixnum(getSignificantDigits().length()), context.runtime.newFixnum(((getAllDigits().length() / 4) + 1) * 4)); }