@Override protected IRubyObject innerCall(ThreadContext context, IRubyObject fallback, IRubyObject c) { return ((RubyHash)fallback).op_aref(context, c); } };
@Override protected IRubyObject innerCall(ThreadContext context, IRubyObject fallback, IRubyObject c) { return ((RubyHash)fallback).op_aref(context, c); } };
@JRubyMethod(name = "__map_symbol") public IRubyObject mapSymbol(final ThreadContext context, IRubyObject symbol){ return symbolMap.op_aref(context, symbol); } }
@JRubyMethod(name = "__map_symbol") public IRubyObject mapSymbol(final ThreadContext context, IRubyObject symbol){ return symbolMap.op_aref(context, symbol); } }
protected IRubyObject case_aware_op_aref(ThreadContext context, IRubyObject key, boolean caseSensitive) { if (! caseSensitive) { key = getCorrectKey(key, context); } return super.op_aref(context, key); }
protected IRubyObject case_aware_op_aref(ThreadContext context, IRubyObject key, boolean caseSensitive) { if (! caseSensitive) { key = getCorrectKey(key, context); } return super.op_aref(context, key); }
/** * Note: this is included as a compatibility measure for Mongrel+JRuby * @deprecated use RubyHash.op_aref instead */ public IRubyObject aref(IRubyObject key) { return op_aref(getRuntime().getCurrentContext(), key); }
/** * Note: this is included as a compatibility measure for Mongrel+JRuby * @deprecated use RubyHash.op_aref instead */ public IRubyObject aref(IRubyObject key) { return op_aref(getRuntime().getCurrentContext(), key); }
/** * Note: this is included as a compatibility measure for Mongrel+JRuby * @deprecated use RubyHash.op_aref instead */ public IRubyObject aref(IRubyObject key) { return op_aref(getRuntime().getCurrentContext(), key); }
@JRubyMethod(name = "ruby", meta = true) public static IRubyObject ruby(ThreadContext context, IRubyObject recv) { Ruby runtime = context.runtime; RubyHash configHash = (RubyHash) runtime.getModule("RbConfig").getConstant("CONFIG"); IRubyObject bindir = configHash.op_aref(context, runtime.newString("bindir")); IRubyObject ruby_install_name = configHash.op_aref(context, runtime.newString("ruby_install_name")); IRubyObject exeext = configHash.op_aref(context, runtime.newString("EXEEXT")); return Helpers.invoke(context, runtime.getClass("File"), "join", bindir, ruby_install_name.callMethod(context, "+", exeext)); }
/** rb_hash_values_at * */ @JRubyMethod(name = "values_at", rest = true) public RubyArray values_at(ThreadContext context, IRubyObject[] args) { RubyArray result = RubyArray.newBlankArrayInternal(context.runtime, args.length); for (int i = 0; i < args.length; i++) { result.store(i, op_aref(context, args[i])); } return result; }
@JRubyMethod(name = "ruby", module = true, compat = CompatVersion.RUBY1_9) public static IRubyObject ruby(ThreadContext context, IRubyObject recv) { Ruby runtime = context.runtime; RubyHash configHash = (RubyHash) runtime.getModule("RbConfig").getConstant("CONFIG"); IRubyObject bindir = configHash.op_aref(context, runtime.newString("bindir")); IRubyObject ruby_install_name = configHash.op_aref(context, runtime.newString("ruby_install_name")); IRubyObject exeext = configHash.op_aref(context, runtime.newString("EXEEXT")); return Helpers.invoke(context, runtime.getClass("File"), "join", bindir, ruby_install_name.callMethod(context, "+", exeext)); }
/** rb_hash_values_at * */ @JRubyMethod(name = "values_at", rest = true) public RubyArray values_at(ThreadContext context, IRubyObject[] args) { RubyArray result = RubyArray.newBlankArrayInternal(context.runtime, args.length); for (int i = 0; i < args.length; i++) { result.store(i, op_aref(context, args[i])); } return result; }
public static RubyString getHomeDirectoryPath(ThreadContext context) { final RubyString homeKey = RubyString.newStringShared(context.runtime, HOME); return getHomeDirectoryPath(context, context.runtime.getENV().op_aref(context, homeKey)); }
/** rb_hash_values_at * */ @JRubyMethod(name = "values_at", rest = true) public RubyArray values_at(ThreadContext context, IRubyObject[] args) { RubyArray result = RubyArray.newArray(getRuntime(), args.length); for (int i = 0; i < args.length; i++) { result.append(op_aref(context, args[i])); } return result; }
/** rb_hash_values_at * */ @JRubyMethod(name = "values_at", rest = true) public RubyArray values_at(ThreadContext context, IRubyObject[] args) { RubyArray result = RubyArray.newArray(getRuntime(), args.length); for (int i = 0; i < args.length; i++) { result.append(op_aref(context, args[i])); } return result; }
private static IRubyObject getEnvTimeZone(Ruby runtime) { RubyString tzVar = runtime.newString(TZ_STRING); RubyHash h = ((RubyHash)runtime.getObject().getConstant("ENV")); IRubyObject tz = h.op_aref(runtime.getCurrentContext(), tzVar); return tz; }
public static File findPathExecutable(Ruby runtime, String fname) { RubyHash env = (RubyHash) runtime.getObject().getConstant("ENV"); IRubyObject pathObject = env.op_aref(runtime.getCurrentContext(), RubyString.newString(runtime, PATH_ENV)); return findPathExecutable(runtime, fname, pathObject); }
@JIT public static IRubyObject callOptimizedAref(ThreadContext context, IRubyObject caller, IRubyObject target, RubyString keyStr, CallSite site) { if (target instanceof RubyHash && ((CachingCallSite) site).isBuiltin(target.getMetaClass())) { // call directly with cached frozen string return ((RubyHash) target).op_aref(context, keyStr); } return site.call(context, caller, target, keyStr.strDup(context.runtime)); }
@JIT public static IRubyObject callOptimizedAref(ThreadContext context, IRubyObject caller, IRubyObject target, RubyString keyStr, CallSite site) { if (target instanceof RubyHash && ((CachingCallSite) site).isBuiltin(target.getMetaClass())) { // call directly with cached frozen string return ((RubyHash) target).op_aref(context, keyStr); } return site.call(context, caller, target, keyStr.strDup(context.runtime)); }