public static IRubyObject getOptionsArg(Ruby runtime, IRubyObject... args) { if (args.length >= 1) { return TypeConverter.checkHashType(runtime, args[args.length - 1]); } return runtime.getNil(); }
public static IRubyObject getOptionsArg(Ruby runtime, IRubyObject arg) { if (arg == null) return runtime.getNil(); return TypeConverter.checkHashType(runtime, arg); }
public static IRubyObject getOptionsArg(Ruby runtime, IRubyObject... args) { if (args.length >= 1) { return TypeConverter.checkHashType(runtime, args[args.length - 1]); } return runtime.getNil(); } }
public static IRubyObject getOptionsArg(Ruby runtime, IRubyObject... args) { if (args.length >= 1) { return TypeConverter.checkHashType(runtime, args[args.length - 1]); } return runtime.getNil(); }
public static IRubyObject getOptionsArg(Ruby runtime, IRubyObject... args) { if (args.length >= 1) { return TypeConverter.checkHashType(runtime, args[args.length - 1]); } return runtime.getNil(); } }
public static IRubyObject getOptionsArg(Ruby runtime, IRubyObject arg) { if (arg == null) return runtime.getNil(); return TypeConverter.checkHashType(runtime, arg); }
public static Encoding strTranscode(ThreadContext context, IRubyObject[] args, IRubyObject[] self_p) { int ecflags = 0; int argc = args.length; IRubyObject[] ecopts_p = {context.nil}; if (args.length >= 1) { IRubyObject tmp = TypeConverter.checkHashType(context.runtime, args[args.length -1]); if (!tmp.isNil()) { argc--; ecflags = econvPrepareOpts(context, tmp, ecopts_p); } } return strTranscode0(context, argc, args, self_p, ecflags, ecopts_p[0]); }
public static Encoding strTranscode(ThreadContext context, IRubyObject[] args, IRubyObject[] self_p) { int ecflags = 0; int argc = args.length; IRubyObject[] ecopts_p = {context.nil}; if (args.length >= 1) { IRubyObject tmp = TypeConverter.checkHashType(context.runtime, args[args.length - 1]); if (!tmp.isNil()) { argc--; ecflags = econvPrepareOpts(context, tmp, ecopts_p); } } return strTranscode0(context, argc, args, self_p, ecflags, ecopts_p[0]); }
public static Encoding strTranscode(ThreadContext context, IRubyObject[] args, IRubyObject[] self_p) { int ecflags = 0; int argc = args.length; IRubyObject[] ecopts_p = {context.nil}; if (args.length >= 1) { IRubyObject tmp = TypeConverter.checkHashType(context.runtime, args[args.length - 1]); if (!tmp.isNil()) { argc--; ecflags = econvPrepareOpts(context, tmp, ecopts_p); } } return strTranscode0(context, argc, args, self_p, ecflags, ecopts_p[0]); }
public static Encoding strTranscode(ThreadContext context, IRubyObject[] args, IRubyObject[] self_p) { int ecflags = 0; int argc = args.length; IRubyObject[] ecopts_p = {context.nil}; if (args.length >= 1) { IRubyObject tmp = TypeConverter.checkHashType(context.runtime, args[args.length -1]); if (!tmp.isNil()) { argc--; ecflags = econvPrepareOpts(context, tmp, ecopts_p); } } return strTranscode0(context, argc, args, self_p, ecflags, ecopts_p[0]); }
@JRubyMethod(name = "initialize", visibility = PRIVATE, compat = RUBY1_9) public IRubyObject initialize19(ThreadContext context, IRubyObject fileNumber, IRubyObject second, Block unused) { int fileno = RubyNumeric.fix2int(fileNumber); IRubyObject vmode = null; IRubyObject options = null; IRubyObject hashTest = TypeConverter.checkHashType(context.runtime, second); if (hashTest instanceof RubyHash) { options = hashTest; } else { options = context.nil; vmode = second; } return initializeCommon19(context, fileno, vmode, options); }
@JRubyMethod public IRubyObject set_encoding(ThreadContext context, IRubyObject encodingString, IRubyObject internalEncoding) { IRubyObject opt = TypeConverter.checkHashType(context.runtime, internalEncoding); if (!opt.isNil()) { setEncoding(context, encodingString, context.nil, opt); } else { setEncoding(context, encodingString, internalEncoding, context.nil); } return this; }
@JRubyMethod(compat=RUBY1_9) public IRubyObject set_encoding(ThreadContext context, IRubyObject encodingString, IRubyObject internalEncoding) { IRubyObject opt = TypeConverter.checkHashType(context.runtime, internalEncoding); if (!opt.isNil()) { setEncoding(context, encodingString, context.nil, opt); } else { setEncoding(context, encodingString, internalEncoding, context.nil); } return context.nil; }
@JRubyMethod public IRubyObject set_encoding(ThreadContext context, IRubyObject encodingString, IRubyObject internalEncoding) { IRubyObject opt = TypeConverter.checkHashType(context.runtime, internalEncoding); if (!opt.isNil()) { setEncoding(context, encodingString, context.nil, opt); } else { setEncoding(context, encodingString, internalEncoding, context.nil); } return this; }
@JRubyMethod(compat=RUBY1_9) public IRubyObject set_encoding(ThreadContext context, IRubyObject encodingString, IRubyObject internalEncoding) { IRubyObject opt = TypeConverter.checkHashType(context.runtime, internalEncoding); if (!opt.isNil()) { setEncoding(context, encodingString, context.nil, opt); } else { setEncoding(context, encodingString, internalEncoding, context.nil); } return context.nil; }
@JRubyMethod(name = "initialize", required = 1, optional = 1, visibility = PRIVATE, compat = RUBY1_9) public IRubyObject initialize19(ThreadContext context, IRubyObject[] args) { Ruby runtime = context.runtime; IRubyObject obj = initialize(context, args[0]); IRubyObject opt = context.nil; if (args.length == 2) { opt = args[1]; if (TypeConverter.checkHashType(runtime, opt).isNil()) { throw runtime.newArgumentError(2, 1); } } ecopts(context, opt); return obj; }
@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; }
@JIT @Interp public static IRubyObject mergeKeywordArguments(ThreadContext context, IRubyObject restKwarg, IRubyObject explicitKwarg) { RubyHash hash = (RubyHash) TypeConverter.checkHashType(context.runtime, restKwarg).dup(); hash.modify(); final RubyHash otherHash = explicitKwarg.convertToHash(); if (otherHash.empty_p().isTrue()) return hash; otherHash.visitAll(context, new KwargMergeVisitor(hash), Block.NULL_BLOCK); return hash; }
@JIT @Interp public static IRubyObject mergeKeywordArguments(ThreadContext context, IRubyObject restKwarg, IRubyObject explicitKwarg) { RubyHash hash = (RubyHash) TypeConverter.checkHashType(context.runtime, restKwarg).dup(); hash.modify(); final RubyHash otherHash = explicitKwarg.convertToHash(); if (otherHash.empty_p().isTrue()) return hash; otherHash.visitAll(context, new KwargMergeVisitor(hash), Block.NULL_BLOCK); return hash; }
@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; }