本文整理了Java中org.jruby.RubyModule.searchInternalModuleVariable
方法的一些代码示例,展示了RubyModule.searchInternalModuleVariable
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyModule.searchInternalModuleVariable
方法的具体详情如下:
包路径:org.jruby.RubyModule
类名称:RubyModule
方法名:searchInternalModuleVariable
[英]Behaves similarly to #getClassVar(String). Searches this class/module and its ancestors for the specified internal variable.
[中]行为类似于#getClassVar(字符串)。在此类/模块及其祖先中搜索指定的内部变量。
代码示例来源:origin: org.jruby/jruby-complete
/**
* Retrieve vpPrecLimit.
*/
@JRubyMethod(meta = true)
public static IRubyObject limit(ThreadContext context, IRubyObject recv) {
return ((RubyModule) recv).searchInternalModuleVariable("vpPrecLimit");
}
代码示例来源:origin: org.jruby/jruby-core
/**
* Retrieve vpPrecLimit.
*/
@JRubyMethod(meta = true)
public static IRubyObject limit(ThreadContext context, IRubyObject recv) {
return ((RubyModule) recv).searchInternalModuleVariable("vpPrecLimit");
}
代码示例来源:origin: org.jruby/jruby-core
private static IRubyObject modeExecute(final ThreadContext context, final RubyModule BigDecimal,
final Block block, final String intVariableName) {
IRubyObject current = BigDecimal.searchInternalModuleVariable(intVariableName);
try {
return block.yieldSpecific(context);
}
finally {
BigDecimal.setInternalModuleVariable(intVariableName, current);
}
}
代码示例来源:origin: org.jruby/jruby-complete
private static IRubyObject modeExecute(final ThreadContext context, final RubyModule BigDecimal,
final Block block, final String intVariableName) {
IRubyObject current = BigDecimal.searchInternalModuleVariable(intVariableName);
try {
return block.yieldSpecific(context);
}
finally {
BigDecimal.setInternalModuleVariable(intVariableName, current);
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "save_limit", meta = true)
public static IRubyObject save_limit(ThreadContext context, IRubyObject recv, Block block) {
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpPrecLimit");
IRubyObject ret;
try {
ret = block.yieldSpecific(context);
} finally {
c.setInternalModuleVariable("vpPrecLimit", nCur);
}
return ret;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "save_exception_mode", meta = true)
public static IRubyObject save_exception_mode(ThreadContext context, IRubyObject recv, Block block) {
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpExceptionMode");
IRubyObject ret;
try {
ret = block.yieldSpecific(context);
} finally {
c.setInternalModuleVariable("vpExceptionMode", nCur);
}
return ret;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "save_rounding_mode", meta = true)
public static IRubyObject save_rounding_mode(ThreadContext context, IRubyObject recv, Block block) {
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpRoundingMode");
IRubyObject ret;
try {
ret = block.yieldSpecific(context);
} finally {
c.setInternalModuleVariable("vpRoundingMode", nCur);
}
return ret;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "save_limit", meta = true)
public static IRubyObject save_limit(ThreadContext context, IRubyObject recv, Block block) {
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpPrecLimit");
IRubyObject ret;
try {
ret = block.yieldSpecific(context);
} finally {
c.setInternalModuleVariable("vpPrecLimit", nCur);
}
return ret;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "save_rounding_mode", meta = true)
public static IRubyObject save_rounding_mode(ThreadContext context, IRubyObject recv, Block block) {
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpRoundingMode");
IRubyObject ret;
try {
ret = block.yieldSpecific(context);
} finally {
c.setInternalModuleVariable("vpRoundingMode", nCur);
}
return ret;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "save_exception_mode", meta = true)
public static IRubyObject save_exception_mode(ThreadContext context, IRubyObject recv, Block block) {
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpExceptionMode");
IRubyObject ret;
try {
ret = block.yieldSpecific(context);
} finally {
c.setInternalModuleVariable("vpExceptionMode", nCur);
}
return ret;
}
代码示例来源:origin: org.jruby/jruby-complete
if (value.isNil()) return c.searchInternalModuleVariable("vpExceptionMode");
if (!(value instanceof RubyBoolean)) throw context.runtime.newArgumentError("second argument must be true or false");
long newExceptionMode = c.searchInternalModuleVariable("vpExceptionMode").convertToInteger().getLongValue();
return c.searchInternalModuleVariable("vpRoundingMode");
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "limit", optional = 1, meta = true)
public static IRubyObject limit(IRubyObject recv, IRubyObject[] args) {
Ruby runtime = recv.getRuntime();
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpPrecLimit");
if (args.length > 0) {
IRubyObject arg = args[0];
if (!arg.isNil()) {
if (!(arg instanceof RubyFixnum)) {
throw runtime.newTypeError(arg, runtime.getFixnum());
}
if (0 > ((RubyFixnum)arg).getLongValue()) {
throw runtime.newArgumentError("argument must be positive");
}
c.setInternalModuleVariable("vpPrecLimit", arg);
}
}
return nCur;
}
代码示例来源:origin: org.jruby/jruby-core
if (value.isNil()) return c.searchInternalModuleVariable("vpExceptionMode");
if (!(value instanceof RubyBoolean)) throw context.runtime.newArgumentError("second argument must be true or false");
long newExceptionMode = c.searchInternalModuleVariable("vpExceptionMode").convertToInteger().getLongValue();
return c.searchInternalModuleVariable("vpRoundingMode");
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = "limit", optional = 1, meta = true)
public static IRubyObject limit(IRubyObject recv, IRubyObject[] args) {
Ruby runtime = recv.getRuntime();
RubyModule c = (RubyModule)recv;
IRubyObject nCur = c.searchInternalModuleVariable("vpPrecLimit");
if (args.length > 0) {
IRubyObject arg = args[0];
if (!arg.isNil()) {
if (!(arg instanceof RubyFixnum)) {
throw runtime.newTypeError(arg, runtime.getFixnum());
}
if (0 > ((RubyFixnum)arg).getLongValue()) {
throw runtime.newArgumentError("argument must be positive");
}
c.setInternalModuleVariable("vpPrecLimit", arg);
}
}
return nCur;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
if ((longMode & EXCEPTION_ALL) != 0) {
if (value.isNil()) {
return c.searchInternalModuleVariable("vpExceptionMode");
RubyFixnum currentExceptionMode = (RubyFixnum)c.searchInternalModuleVariable("vpExceptionMode");
RubyFixnum newExceptionMode = new RubyFixnum(runtime, currentExceptionMode.getLongValue());
if (longMode == ROUND_MODE) {
if (value.isNil()) {
return c.searchInternalModuleVariable("vpRoundingMode");
throw runtime.newTypeError("invalid rounding mode");
return c.searchInternalModuleVariable("vpRoundingMode");
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
if ((longMode & EXCEPTION_ALL) != 0) {
if (value.isNil()) {
return c.searchInternalModuleVariable("vpExceptionMode");
RubyFixnum currentExceptionMode = (RubyFixnum)c.searchInternalModuleVariable("vpExceptionMode");
RubyFixnum newExceptionMode = new RubyFixnum(runtime, currentExceptionMode.getLongValue());
if (longMode == ROUND_MODE) {
if (value.isNil()) {
return c.searchInternalModuleVariable("vpRoundingMode");
throw runtime.newTypeError("invalid rounding mode");
return c.searchInternalModuleVariable("vpRoundingMode");
内容来源于网络,如有侵权,请联系作者删除!