本文整理了Java中org.jruby.Ruby.newNoMethodError
方法的一些代码示例,展示了Ruby.newNoMethodError
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newNoMethodError
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newNoMethodError
[英]Construct a NoMethodError with a pre-formatted message.
[中]使用预先格式化的消息构造NoMethodError。
代码示例来源:origin: org.jruby/jruby-core
/**
* @see Ruby#newNoMethodError(String, IRubyObject, String, RubyArray, boolean)
*/
public RaiseException newNoMethodError(String message, IRubyObject recv, String name, RubyArray args) {
return newNoMethodError(message, recv, name, args, false);
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* @see Ruby#newNoMethodError(String, IRubyObject, String, RubyArray, boolean)
*/
public RaiseException newNoMethodError(String message, IRubyObject recv, String name, RubyArray args) {
return newNoMethodError(message, recv, name, args, false);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule klass, String name) {
if (klass == null) {
if (name != null) {
throw context.runtime.newNameError("superclass method '" + name + "' disabled", name);
} else {
throw context.runtime.newNoMethodError("super called outside of method", null, context.nil);
}
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule klass, String name) {
if (klass == null) {
if (name != null) {
throw context.runtime.newNameError("superclass method '" + name + "' disabled", name);
} else {
throw context.runtime.newNoMethodError("super called outside of method", null, context.nil);
}
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
protected static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule frameClass, String frameName) {
if (frameClass == null) {
if (frameName != null) {
throw context.runtime.newNameError("superclass method '" + frameName + "' disabled", frameName);
} else {
throw context.runtime.newNoMethodError("super called outside of method", null, context.runtime.getNil());
}
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
protected static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule frameClass, String methodName) {
// FIXME: super/zsuper in top-level script still seems to have a frameClass so it will not make it into this if
if (frameClass == null) {
if (methodName == null || methodName != "") {
throw context.runtime.newNameError("superclass method '" + methodName + "' disabled", methodName);
} else {
throw context.runtime.newNoMethodError("super called outside of method", null, context.runtime.getNil());
}
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
protected static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule frameClass, String frameName) {
if (frameClass == null) {
if (frameName != null) {
throw context.runtime.newNameError("superclass method '" + frameName + "' disabled", frameName);
} else {
throw context.runtime.newNoMethodError("super called outside of method", null, context.runtime.getNil());
}
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
protected static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule frameClass, String methodName) {
// FIXME: super/zsuper in top-level script still seems to have a frameClass so it will not make it into this if
if (frameClass == null) {
if (methodName == null || methodName != "") {
throw context.runtime.newNameError("superclass method '" + methodName + "' disabled", methodName);
} else {
throw context.runtime.newNoMethodError("super called outside of method", null, context.runtime.getNil());
}
}
}
代码示例来源:origin: org.jruby/jruby-complete
public static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule klass, String name) {
if (klass == null) {
if (name != null) {
Ruby runtime = context.runtime;
throw runtime.newNameError(str(runtime, "superclass method '", ids(runtime, name), "' disabled"), name);
}
}
if (name == null) {
throw context.runtime.newNoMethodError("super called outside of method", null, context.nil);
}
}
代码示例来源:origin: org.jruby/jruby-core
public static void checkSuperDisabledOrOutOfMethod(ThreadContext context, RubyModule klass, String name) {
if (klass == null) {
if (name != null) {
Ruby runtime = context.runtime;
throw runtime.newNameError(str(runtime, "superclass method '", ids(runtime, name), "' disabled"), name);
}
}
if (name == null) {
throw context.runtime.newNoMethodError("super called outside of method", null, context.nil);
}
}
代码示例来源:origin: org.jruby/jruby-complete
public static IRubyObject methodMissing(ThreadContext context, IRubyObject recv, String name, Visibility lastVis, CallType lastCallType, IRubyObject[] args, boolean dropFirst) {
Ruby runtime = context.runtime;
boolean privateCall = false;
if (lastCallType == CallType.VARIABLE || lastCallType == CallType.FUNCTIONAL) {
privateCall = true;
} else if (lastVis == PUBLIC) {
privateCall = true;
}
if (lastCallType == CallType.VARIABLE) {
throw runtime.newNameError(getMethodMissingFormat(lastVis, lastCallType), recv, name, privateCall);
}
throw runtime.newNoMethodError(getMethodMissingFormat(lastVis, lastCallType), recv, name, RubyArray.newArrayMayCopy(runtime, args, dropFirst ? 1 : 0), privateCall);
}
代码示例来源:origin: org.jruby/jruby-core
public static IRubyObject methodMissing(ThreadContext context, IRubyObject recv, String name, Visibility lastVis, CallType lastCallType, IRubyObject[] args, boolean dropFirst) {
Ruby runtime = context.runtime;
boolean privateCall = false;
if (lastCallType == CallType.VARIABLE || lastCallType == CallType.FUNCTIONAL) {
privateCall = true;
} else if (lastVis == PUBLIC) {
privateCall = true;
}
if (lastCallType == CallType.VARIABLE) {
throw runtime.newNameError(getMethodMissingFormat(lastVis, lastCallType), recv, name, privateCall);
}
throw runtime.newNoMethodError(getMethodMissingFormat(lastVis, lastCallType), recv, name, RubyArray.newArrayMayCopy(runtime, args, dropFirst ? 1 : 0), privateCall);
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "new", meta = true)
public static final IRubyObject newMappedType(ThreadContext context, IRubyObject klass, IRubyObject converter) {
if (!converter.respondsTo("native_type")) {
throw context.runtime.newNoMethodError("converter needs a native_type method", "native_type", converter.getMetaClass());
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "new", meta = true)
public static final IRubyObject newMappedType(ThreadContext context, IRubyObject klass, IRubyObject converter) {
if (!converter.respondsTo("native_type")) {
throw context.runtime.newNoMethodError("converter needs a native_type method", "native_type", converter.getMetaClass());
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(name = "new", meta = true)
public static final IRubyObject newMappedType(ThreadContext context, IRubyObject klass, IRubyObject converter) {
if (!converter.respondsTo("native_type")) {
throw context.runtime.newNoMethodError("converter needs a native_type method", "native_type", converter.getMetaClass());
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "new", meta = true)
public static final IRubyObject newMappedType(ThreadContext context, IRubyObject klass, IRubyObject converter) {
if (!converter.respondsTo("native_type")) {
throw context.runtime.newNoMethodError("converter needs a native_type method", "native_type", converter.getMetaClass());
内容来源于网络,如有侵权,请联系作者删除!