@Override public boolean contains(RubyHash hash, Object o) { return hash.containsKey(o); } @Override
public boolean contains(RubyHash hash, Object o) { return hash.containsKey(o); } public boolean remove(RubyHash hash, Object o) {
@Override public boolean contains(RubyHash hash, Object o) { return hash.containsKey(o); } @Override
public boolean contains(RubyHash hash, Object o) { return hash.containsKey(o); } public boolean remove(RubyHash hash, Object o) {
@Override public boolean containsKey(Object key) { if (!(key instanceof String)) { return false; } return rubyHash.containsKey(convertJavaToRubyKey((String) key)); }
@Override public boolean containsKey(Object key) { if (!(key instanceof String)) { return false; } return rubyHash.containsKey(convertJavaToRubyKey((String) key)); }
@Override public boolean containsKey(Object key) { if (!(key instanceof String)) { return false; } RubySymbol symbol = rubyHash.getRuntime().getSymbolTable().getSymbol((String) key); return rubyHash.containsKey(symbol); }
@Override public boolean containsKey(Object key) { if (!(key instanceof String)) { return false; } RubySymbol symbol = rubyHash.getRuntime().getSymbolTable().getSymbol((String) key); return rubyHash.containsKey(symbol); }
/** * Warn when using unsupported options. * * @param options */ private static void checkUnsupportedOptions(IRubyObject options, Set<String> unsupported, String error) { if (options == null || options.isNil() || !(options instanceof RubyHash)) return; RubyHash optsHash = (RubyHash)options; Ruby runtime = optsHash.getRuntime(); for (String key : unsupported) { if (optsHash.containsKey(runtime.newSymbol(key))) { runtime.getWarnings().warn(error + ": " + key); } } }
/** * Warn when using unsupported options. * * @param options */ private static void checkUnsupportedOptions(IRubyObject options, Set<String> unsupported, String error) { if (options == null || options.isNil() || !(options instanceof RubyHash)) return; RubyHash optsHash = (RubyHash)options; Ruby runtime = optsHash.getRuntime(); for (String key : unsupported) { if (optsHash.containsKey(runtime.newSymbol(key))) { runtime.getWarnings().warn(error + ": " + key); } } }
private RubyFixnum getTTL(ThreadContext context, IRubyObject[] args, int index) { Ruby ruby = context.getRuntime(); if (args.length > index) { if (args[index] instanceof RubyFixnum) { return (RubyFixnum) args[index]; } else if (args[index] instanceof RubyHash) { RubyHash options = (RubyHash) args[index]; if (options.containsKey(ruby.newSymbol("ttl"))) { Long ttl = (Long) options.get(ruby.newSymbol("ttl")); return ruby.newFixnum(ttl); } else if (options.containsKey(ruby.newSymbol("expires_in"))) { Long expiresIn = (Long) options.get(ruby.newSymbol("expires_in")); return ruby.newFixnum(expiresIn); } } } return ruby.newFixnum(super.getDefaultTTL()); }
if (options.containsKey(runtime.newSymbol("mode"))) { ioOptions = parseIOOptions19(options.fastARef(runtime.newSymbol("mode"))); if (options.containsKey(runtime.newSymbol("binmode")) && options.fastARef(runtime.newSymbol("binmode")).isTrue()) { if (options.containsKey(runtime.newSymbol("binmode")) && options.fastARef(runtime.newSymbol("binmode")).isTrue()) { if (options.containsKey(runtime.newSymbol("textmode")) && options.fastARef(runtime.newSymbol("textmode")).isTrue()) { if (options.containsKey(runtime.newSymbol("open_args"))) { IRubyObject args = options.fastARef(runtime.newSymbol("open_args"));
if (options.containsKey(runtime.newSymbol("mode"))) { ioOptions = parseIOOptions19(options.fastARef(runtime.newSymbol("mode"))); if (options.containsKey(runtime.newSymbol("binmode")) && options.fastARef(runtime.newSymbol("binmode")).isTrue()) { if (options.containsKey(runtime.newSymbol("binmode")) && options.fastARef(runtime.newSymbol("binmode")).isTrue()) { if (options.containsKey(runtime.newSymbol("textmode")) && options.fastARef(runtime.newSymbol("textmode")).isTrue()) { if (options.containsKey(runtime.newSymbol("open_args"))) { IRubyObject args = options.fastARef(runtime.newSymbol("open_args"));
} else if (!options.containsKey(runtime.newSymbol("mode"))) { mode |= ModeFlags.WRONLY; file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);
} else if (!options.containsKey(runtime.newSymbol("mode"))) { mode |= ModeFlags.WRONLY; file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);
} else if (!options.containsKey(runtime.newSymbol("mode"))) { mode |= ModeFlags.WRONLY; file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);
} else if (!options.containsKey(runtime.newSymbol("mode"))) { mode |= ModeFlags.WRONLY; file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, RubyFixnum.newFixnum(runtime, mode), options);