@JRubyMethod(required = 1, optional = 1, module = true, visibility = PRIVATE) public static IRubyObject trace_var(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) { RubyProc proc = null; String var = args[0].toString(); // ignore if it's not a global var if (var.charAt(0) != '$') { return context.nil; } if (args.length == 1) { proc = RubyProc.newProc(context.runtime, block, Block.Type.PROC); } if (args.length == 2) { proc = (RubyProc)TypeConverter.convertToType(args[1], context.runtime.getProc(), "to_proc", true); } context.runtime.getGlobalVariables().setTraceVar(var, proc); return context.nil; }
@JRubyMethod(required = 1, optional = 1, module = true, visibility = PRIVATE) public static IRubyObject trace_var(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) { RubyProc proc = null; String var = args[0].toString(); // ignore if it's not a global var if (var.charAt(0) != '$') { return context.nil; } if (args.length == 1) { proc = RubyProc.newProc(context.runtime, block, Block.Type.PROC); } if (args.length == 2) { proc = (RubyProc)TypeConverter.convertToType(args[1], context.runtime.getProc(), "to_proc", true); } context.runtime.getGlobalVariables().setTraceVar(var, proc); return context.nil; }
@JRubyMethod(required = 1, optional = 1, module = true, visibility = PRIVATE) public static IRubyObject trace_var(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) { RubyProc proc = null; String var = args[0].toString(); // ignore if it's not a global var if (var.charAt(0) != '$') { return context.runtime.getNil(); } if (args.length == 1) { proc = RubyProc.newProc(context.runtime, block, Block.Type.PROC); } if (args.length == 2) { proc = (RubyProc)TypeConverter.convertToType(args[1], context.runtime.getProc(), "to_proc", true); } context.runtime.getGlobalVariables().setTraceVar(var, proc); return context.runtime.getNil(); }
@JRubyMethod(required = 1, optional = 1, module = true, visibility = PRIVATE) public static IRubyObject trace_var(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) { RubyProc proc = null; String var = args[0].toString(); // ignore if it's not a global var if (var.charAt(0) != '$') { return context.runtime.getNil(); } if (args.length == 1) { proc = RubyProc.newProc(context.runtime, block, Block.Type.PROC); } if (args.length == 2) { proc = (RubyProc)TypeConverter.convertToType(args[1], context.runtime.getProc(), "to_proc", true); } context.runtime.getGlobalVariables().setTraceVar(var, proc); return context.runtime.getNil(); }