private Metadata getMetadata(RubyModule type) { for (RubyModule current = type; current != null; current = current.getSuperClass()) { Metadata metadata = (Metadata) current.getInternalVariable("metadata"); if (metadata != null) return metadata; } return null; }
private Metadata getMetadata(RubyModule type) { for (RubyModule current = type; current != null; current = current.getSuperClass()) { Metadata metadata = (Metadata) current.getInternalVariable("metadata"); if (metadata != null) return metadata; } return null; }
private Metadata getMetadata(RubyModule type) { for (RubyModule current = type; current != null; current = current.getSuperClass()) { Metadata metadata = (Metadata) current.getInternalVariable("metadata"); if (metadata != null) return metadata; } return null; }
private Metadata getMetadata(RubyModule type) { for (RubyModule current = type; current != null; current = current.getSuperClass()) { Metadata metadata = (Metadata) current.getInternalVariable("metadata"); if (metadata != null) return metadata; } return null; }
/** * Behaves similarly to {@link #getClassVar(String)}. Searches this * class/module <em>and its ancestors</em> for the specified internal * variable. * * @param name the internal variable name * @return the value of the specified internal variable if found, else null * @see #setInternalModuleVariable(String, IRubyObject) */ public IRubyObject searchInternalModuleVariable(final String name) { for (RubyModule module = this; module != null; module = module.getSuperClass()) { IRubyObject value = (IRubyObject)module.getInternalVariable(name); if (value != null) return value; } return null; }
/** * Behaves similarly to {@link #getClassVar(String)}. Searches this * class/module <em>and its ancestors</em> for the specified internal * variable. * * @param name the internal variable name * @return the value of the specified internal variable if found, else null * @see #setInternalModuleVariable(String, IRubyObject) */ public IRubyObject searchInternalModuleVariable(final String name) { for (RubyModule module = this; module != null; module = module.getSuperClass()) { IRubyObject value = (IRubyObject)module.getInternalVariable(name); if (value != null) return value; } return null; }
/** * Behaves similarly to {@link #getClassVar(String)}. Searches this * class/module <em>and its ancestors</em> for the specified internal * variable. * * @param name the internal variable name * @return the value of the specified internal variable if found, else null * @see #setInternalModuleVariable(String, IRubyObject) */ public IRubyObject searchInternalModuleVariable(final String name) { for (RubyModule module = this; module != null; module = module.getSuperClass()) { IRubyObject value = (IRubyObject)module.getInternalVariable(name); if (value != null) return value; } return null; }
/** * Behaves similarly to {@link #getClassVar(String)}. Searches this * class/module <em>and its ancestors</em> for the specified internal * variable. * * @param name the internal variable name * @return the value of the specified internal variable if found, else null * @see #setInternalModuleVariable(String, IRubyObject) */ public IRubyObject searchInternalModuleVariable(final String name) { for (RubyModule module = this; module != null; module = module.getSuperClass()) { IRubyObject value = (IRubyObject)module.getInternalVariable(name); if (value != null) return value; } return null; }
@JRubyMethod(module = true) public static IRubyObject jo(ThreadContext context, IRubyObject self, Block block) { Ruby runtime = context.runtime; RubyModule jo = runtime.getModule("Jo"); ExecutorService executor = (ExecutorService)jo.getInternalVariable("executor"); Future<IRubyObject> future = executor.submit(new JoRoutine(runtime, block)); return new JoFuture(runtime, jo.getClass("Future"), future); }
@JRubyMethod(name = "reference_required?", module=true) public static IRubyObject reference_required_p(ThreadContext context, IRubyObject self) { Object ref = module(self).getInternalVariable("reference_required"); return context.runtime.newBoolean(!(ref instanceof IRubyObject) || ((IRubyObject) ref).isTrue()); }
@JRubyMethod(name = "reference_required?", module=true) public static IRubyObject reference_required_p(ThreadContext context, IRubyObject self) { Object ref = module(self).getInternalVariable("reference_required"); return context.runtime.newBoolean(!(ref instanceof IRubyObject) || ((IRubyObject) ref).isTrue()); }
@JRubyMethod(name = "reference_required?", module=true) public static IRubyObject reference_required_p(ThreadContext context, IRubyObject self) { Object ref = module(self).getInternalVariable("reference_required"); return context.runtime.newBoolean(!(ref instanceof IRubyObject) || ((IRubyObject) ref).isTrue()); }
@JRubyMethod(name = "reference_required?", module=true) public static IRubyObject reference_required_p(ThreadContext context, IRubyObject self) { Object ref = module(self).getInternalVariable("reference_required"); return context.runtime.newBoolean(!(ref instanceof IRubyObject) || ((IRubyObject) ref).isTrue()); }
@JRubyMethod(name = "native_type", module=true, optional = 1) public static IRubyObject native_type(ThreadContext context, IRubyObject self, IRubyObject[] args) { RubyModule m = module(self); if (args.length == 0) { if (!m.hasInternalVariable("native_type")) { throw context.runtime.newNotImplementedError("native_type method not overridden and no native_type set"); } return (Type) m.getInternalVariable("native_type"); } else if (args.length == 1) { Type type = Util.findType(context, args[0]); m.setInternalVariable("native_type", type); return type; } else { throw context.runtime.newArgumentError("incorrect arguments"); } }
@JRubyMethod(name = "native_type", module=true, optional = 1) public static IRubyObject native_type(ThreadContext context, IRubyObject self, IRubyObject[] args) { RubyModule m = module(self); if (args.length == 0) { if (!m.hasInternalVariable("native_type")) { throw context.runtime.newNotImplementedError("native_type method not overridden and no native_type set"); } return (Type) m.getInternalVariable("native_type"); } else if (args.length == 1) { Type type = Util.findType(context, args[0]); m.setInternalVariable("native_type", type); return type; } else { throw context.runtime.newArgumentError("incorrect arguments"); } }
Collection<String> methodNames = (Collection<String>) ancestor.getInternalVariable("__java_ovrd_methods");
@JRubyMethod(name = "native_type", module=true, optional = 1) public static IRubyObject native_type(ThreadContext context, IRubyObject self, IRubyObject[] args) { RubyModule m = module(self); if (args.length == 0) { if (!m.hasInternalVariable("native_type")) { throw context.runtime.newNotImplementedError("native_type method not overridden and no native_type set"); } return (Type) m.getInternalVariable("native_type"); } else if (args.length == 1) { Type type = Util.findType(context, args[0]); m.setInternalVariable("native_type", type); return type; } else { throw context.runtime.newArgumentError("incorrect arguments"); } }
Collection<String> methodNames = (Collection<String>) ancestor.getInternalVariable("__java_ovrd_methods");
@JRubyMethod(name = "native_type", module=true, optional = 1) public static IRubyObject native_type(ThreadContext context, IRubyObject self, IRubyObject[] args) { RubyModule m = module(self); if (args.length == 0) { if (!m.hasInternalVariable("native_type")) { throw context.runtime.newNotImplementedError("native_type method not overridden and no native_type set"); } return (Type) m.getInternalVariable("native_type"); } else if (args.length == 1) { Type type = Util.findType(context, args[0]); m.setInternalVariable("native_type", type); return type; } else { throw context.runtime.newArgumentError("incorrect arguments"); } }