@Override public boolean isEmpty() { return rubyArray.isEmpty(); }
@Override public boolean isEmpty() { return rubyArray.isEmpty(); }
public boolean isEmpty(){ return ( allEnums.isEmpty() && symbolMap.isEmpty() && taggedEnums.isEmpty()); }
public boolean isEmpty(){ return ( allEnums.isEmpty() && symbolMap.isEmpty() && taggedEnums.isEmpty()); }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block block) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), block); }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block blockArg) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } final IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), blockArg); }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block blockArg) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } final IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), blockArg); }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block block) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), block); }
@JRubyMethod(name = "active?") public IRubyObject active_p(ThreadContext context) { Ruby ruby = context.getRuntime(); if (((RubyArray) super.servers(context)).isEmpty()) { return ruby.getFalse(); } return ruby.getTrue(); }
@JRubyMethod(name = "Hash", required = 1, module = true, visibility = PRIVATE) public static IRubyObject new_hash(ThreadContext context, IRubyObject recv, IRubyObject arg) { IRubyObject tmp; Ruby runtime = context.runtime; if (arg == context.nil) return RubyHash.newHash(runtime); tmp = TypeConverter.checkHashType(context, sites(context).to_hash_checked, arg); if (tmp == context.nil) { if (arg instanceof RubyArray && ((RubyArray) arg).isEmpty()) { return RubyHash.newHash(runtime); } throw runtime.newTypeError("can't convert " + arg.getMetaClass() + " into Hash"); } return tmp; }
@JRubyMethod(name = "Hash", required = 1, module = true, visibility = PRIVATE) public static IRubyObject new_hash(ThreadContext context, IRubyObject recv, IRubyObject arg) { IRubyObject tmp; Ruby runtime = context.runtime; if (arg == context.nil) return RubyHash.newHash(runtime); tmp = TypeConverter.checkHashType(context, sites(context).to_hash_checked, arg); if (tmp == context.nil) { if (arg instanceof RubyArray && ((RubyArray) arg).isEmpty()) { return RubyHash.newHash(runtime); } throw runtime.newTypeError("can't convert " + arg.getMetaClass() + " into Hash"); } return tmp; }
@JRubyMethod(name = "any?", optional = 1) public IRubyObject any_p(ThreadContext context, IRubyObject[] args, Block block) { if (isEmpty()) return context.fals; if (!isBuiltin("each")) return RubyEnumerable.any_pCommon(context, this, args, block); boolean patternGiven = args.length > 0; if (!block.isGiven() || patternGiven) return any_pBlockless(context, args); for (int i = 0; i < realLength; i++) { if (block.yield(context, eltOk(i)).isTrue()) return context.tru; } return context.fals; }
@JRubyMethod(name = "any?", optional = 1) public IRubyObject any_p(ThreadContext context, IRubyObject[] args, Block block) { if (isEmpty()) return context.fals; if (!isBuiltin("each")) return RubyEnumerable.any_pCommon(context, this, args, block); boolean patternGiven = args.length > 0; if (!block.isGiven() || patternGiven) return any_pBlockless(context, args); for (int i = 0; i < realLength; i++) { if (block.yield(context, eltOk(i)).isTrue()) return context.tru; } return context.fals; }
@JRubyMethod(name = "Hash", required = 1, module = true, visibility = PRIVATE, compat = RUBY1_9) public static IRubyObject new_hash(ThreadContext context, IRubyObject recv, IRubyObject arg) { IRubyObject tmp; Ruby runtime = recv.getRuntime(); if (arg.isNil()) return RubyHash.newHash(runtime); tmp = TypeConverter.checkHashType(runtime, arg); if (tmp.isNil()) { if (arg instanceof RubyArray && ((RubyArray) arg).isEmpty()) { return RubyHash.newHash(runtime); } throw runtime.newTypeError("can't convert " + arg.getMetaClass() + " into Hash"); } return tmp; }
@JRubyMethod(name = "Hash", required = 1, module = true, visibility = PRIVATE, compat = RUBY1_9) public static IRubyObject new_hash(ThreadContext context, IRubyObject recv, IRubyObject arg) { IRubyObject tmp; Ruby runtime = recv.getRuntime(); if (arg.isNil()) return RubyHash.newHash(runtime); tmp = TypeConverter.checkHashType(runtime, arg); if (tmp.isNil()) { if (arg instanceof RubyArray && ((RubyArray) arg).isEmpty()) { return RubyHash.newHash(runtime); } throw runtime.newTypeError("can't convert " + arg.getMetaClass() + " into Hash"); } return tmp; }
} else { RubyArray arg0Ary = (RubyArray) arg0; if (arg0Ary.isEmpty()) throw runtime.newArgumentError("wrong number of arguments"); if (arg0Ary.eltOk(0) instanceof RubyHash) { if (arg0Ary.isEmpty()) throw runtime.newArgumentError("wrong number of arguments"); if (arg0Ary.size() > 1 && arg0Ary.eltOk(arg0Ary.size() - 1) instanceof RubyHash) {
data.next_p = 1; if (data.argv.isEmpty()) return RubyIO.nonblockEOF(runtime, noException);
data.next_p = 1; if (data.argv.isEmpty()) return RubyIO.nonblockEOF(runtime, noException);