Refine search
@JRubyMethod public IRubyObject initialize(ThreadContext context) { Ruby runtime = context.runtime; this.pendingList = runtime.newArray(); return this; }
@JRubyMethod public IRubyObject each(ThreadContext context, Block block) { Ruby runtime = context.runtime; for (Descriptors.EnumValueDescriptor enumValueDescriptor : descriptor.getValues()) { block.yield(context, runtime.newArray(runtime.newSymbol(enumValueDescriptor.getName()), runtime.newFixnum(enumValueDescriptor.getNumber()))); } return runtime.getNil(); }
@JRubyMethod(name = "finalize_to_pool") public IRubyObject finalizeToPool(ThreadContext context, IRubyObject rbPool) { RubyDescriptorPool pool = (RubyDescriptorPool) rbPool; for (int i = 0; i < this.pendingList.size(); i++) { IRubyObject defRb = this.pendingList.entry(i); if (defRb instanceof RubyDescriptor) { pool.addToSymtab(context, (RubyDescriptor) defRb); } else { pool.addToSymtab(context, (RubyEnumDescriptor) defRb); } } this.pendingList = context.runtime.newArray(); return context.runtime.getNil(); }
@JRubyMethod(required = 1, optional = 2) public IRubyObject initialize(ThreadContext context, IRubyObject[] args) { Ruby runtime = context.runtime; this.storage = runtime.newArray(); IRubyObject ary = null; if (!(args[0] instanceof RubySymbol)) {
/** nucomp_rect * */ @JRubyMethod(name = {"rectangular", "rect"}) @Override public IRubyObject rect(ThreadContext context) { return context.runtime.newArray(real, image); }
/** nucomp_rect * */ @JRubyMethod(name = {"rectangular", "rect"}) @Override public IRubyObject rect(ThreadContext context) { return context.runtime.newArray(real, image); }
@JRubyMethod(name = "rassoc") public IRubyObject rassoc(final ThreadContext context, final IRubyObject obj) { try { visitAll(context, FoundPairIfEqualValueVisitor, obj); return context.nil; } catch (FoundPair found) { return context.runtime.newArray(found.key, found.value); } }
@JRubyMethod(name = {"to_a", "values"}) @Override public RubyArray to_a() { return getRuntime().newArray(values); }
@JRubyMethod(name = "assoc") public IRubyObject assoc(final ThreadContext context, final IRubyObject obj) { try { visitAll(context, FoundPairIfEqualKeyVisitor, obj); return context.nil; } catch (FoundPair found) { return context.runtime.newArray(found.key, found.value); } }
@JRubyMethod(name = "assoc") public IRubyObject assoc(final ThreadContext context, final IRubyObject obj) { try { visitAll(context, FoundPairIfEqualKeyVisitor, obj); return context.nil; } catch (FoundPair found) { return context.runtime.newArray(found.key, found.value); } }
/** rb_mod_ancestors * */ @JRubyMethod(name = "ancestors") public RubyArray ancestors(ThreadContext context) { return context.runtime.newArray(getAncestorList()); }
@JRubyMethod(name = {"to_a", "values"}) @Override public RubyArray to_a() { return getRuntime().newArray(values); }
/** nucomp_marshal_dump * */ @JRubyMethod(name = "marshal_dump") public IRubyObject marshal_dump(ThreadContext context) { RubyArray dump = context.runtime.newArray(real, image); if (hasVariables()) dump.syncVariables(this); return dump; }
@JRubyMethod(name = { "to_a", "entries" }) // @override Enumerable#to_a public static IRubyObject to_a(final ThreadContext context, final IRubyObject self, final Block block) { final Ruby runtime = context.runtime; final RubyArray ary = runtime.newArray(); java.lang.Iterable iterable = unwrapIfJavaObject(self); java.util.Iterator iterator = iterable.iterator(); while ( iterator.hasNext() ) { final Object value = iterator.next(); ary.append( convertJavaToUsableRubyObject(runtime, value) ); } return ary; }
/** nucomp_polar * */ @JRubyMethod(name = "polar") @Override public IRubyObject polar(ThreadContext context) { return context.runtime.newArray(f_abs(context, this), f_arg(context, this)); }
@JRubyMethod public IRubyObject addr(ThreadContext context) { final Ruby runtime = context.runtime; return runtime.newArray( runtime.newString("AF_UNIX"), RubyString.newEmptyString(runtime) ); }
/** nurat_marshal_dump * */ @JRubyMethod(name = "marshal_dump") public IRubyObject marshal_dump(ThreadContext context) { RubyArray dump = context.runtime.newArray(num, den); if (hasVariables()) dump.syncVariables(this); return dump; }
/** flo_coerce * */ @JRubyMethod(name = "coerce", required = 1) @Override public IRubyObject coerce(IRubyObject other) { final Ruby runtime = getRuntime(); return runtime.newArray(RubyKernel.new_float(runtime, other), this); }
/** num_coerce * */ @JRubyMethod(name = "coerce") public IRubyObject coerce(IRubyObject other) { final Ruby runtime = getRuntime(); if (getMetaClass() == other.getMetaClass()) return runtime.newArray(other, this); IRubyObject cdr = RubyKernel.new_float(runtime, this); IRubyObject car = RubyKernel.new_float(runtime, other); return runtime.newArray(car, cdr); }
@JRubyMethod(name = "waitpid2", rest = true, module = true, visibility = PRIVATE) public static IRubyObject waitpid2(ThreadContext context, IRubyObject recv, IRubyObject[] args) { IRubyObject pid = waitpid(context, recv, args); if (pid.isNil()) return pid; return context.runtime.newArray(pid, context.getLastExitStatus()); }