@JRubyMethod(name = "value=", required = 1) public IRubyObject setValue(ThreadContext context, IRubyObject value) { getContextVariables(context).put(this, value); return value; }
protected final Map<Object, IRubyObject> getContextVariables(ThreadContext context) { return getExecutionContext(context).getContextVariables(); }
@JRubyMethod(name = "default_proc") public IRubyObject getDefaultProc() { return (default_proc != null) ? default_proc : getRuntime().getNil(); }
@JRubyMethod(name = "default_proc") public IRubyObject getDefaultProc() { return (default_proc != null) ? default_proc : getRuntime().getNil(); }
@JRubyMethod(name = "value=", required = 1) public IRubyObject setValue(ThreadContext context, IRubyObject value) { getContextVariables(context).put(this, value); return value; }
protected final Map<Object, IRubyObject> getContextVariables(ThreadContext context) { return getExecutionContext(context).getContextVariables(); }
@JRubyMethod(name = "value=", required = 1) public IRubyObject setValue(ThreadContext context, IRubyObject value) { getContextVariables(context).put(this, value); return value; }
protected final Map<Object, IRubyObject> getContextVariables(ThreadContext context) { return getExecutionContext(context).getContextVariables(); }
@JRubyMethod(name = "value=", required = 1) public IRubyObject setValue(ThreadContext context, IRubyObject value) { getContextVariables(context).put(this, value); return value; }
protected final Map<Object, IRubyObject> getContextVariables(ThreadContext context) { return getExecutionContext(context).getContextVariables(); }
@JRubyMethod(name = "value", required = 0) public IRubyObject getValue(ThreadContext context) { final IRubyObject value; final Map<Object, IRubyObject> contextVariables; contextVariables = getContextVariables(context); value = contextVariables.get(this); if (value != null) { return value; } if (default_proc != null) { // pre-set for the sake of terminating recursive calls contextVariables.put(this, context.nil); final IRubyObject new_value; new_value = default_proc.call(context, IRubyObject.NULL_ARRAY, null, Block.NULL_BLOCK); contextVariables.put(this, new_value); return new_value; } return default_value; }
@JRubyMethod(name = "value", required = 0) public IRubyObject getValue(ThreadContext context) { final IRubyObject value; final Map<Object, IRubyObject> contextVariables; contextVariables = getContextVariables(context); value = contextVariables.get(this); if (value != null) { return value; } if (default_proc != null) { // pre-set for the sake of terminating recursive calls contextVariables.put(this, context.nil); final IRubyObject new_value; new_value = default_proc.call(context, IRubyObject.NULL_ARRAY, null, Block.NULL_BLOCK); contextVariables.put(this, new_value); return new_value; } return default_value; }
@JRubyMethod(name = "value", required = 0) public IRubyObject getValue(ThreadContext context) { final IRubyObject value; final Map<Object, IRubyObject> contextVariables; contextVariables = getContextVariables(context); value = contextVariables.get(this); if (value != null) { return value; } else if (default_proc != null) { // pre-set for the sake of terminating recursive calls contextVariables.put(this, context.runtime.getNil()); final IRubyObject new_value; new_value = default_proc.call(context, EMPTY_ARGS, null, Block.NULL_BLOCK); contextVariables.put(this, new_value); return new_value; } else { return default_value; } }
@JRubyMethod(name = "value", required = 0) public IRubyObject getValue(ThreadContext context) { final IRubyObject value; final Map<Object, IRubyObject> contextVariables; contextVariables = getContextVariables(context); value = contextVariables.get(this); if (value != null) { return value; } else if (default_proc != null) { // pre-set for the sake of terminating recursive calls contextVariables.put(this, context.runtime.getNil()); final IRubyObject new_value; new_value = default_proc.call(context, EMPTY_ARGS, null, Block.NULL_BLOCK); contextVariables.put(this, new_value); return new_value; } else { return default_value; } }