/*
* call-seq:
* proc.var => Node
*
* Returns the Proc's argument Node.
*
* This method is undefined on YARV.
*/
static VALUE proc_var(VALUE self)
{
struct BLOCK * b;
if(ruby_safe_level >= 4)
{
/* no access to potentially sensitive data from the sandbox */
rb_raise(rb_eSecurityError, "Insecure: can't get proc var");
}
Data_Get_Struct(self, struct BLOCK, b);
if(b->var == (NODE*)1)
{
/* no parameter || */
return INT2NUM(1);
}
else if(b->var == (NODE*)2)
{
/* also no params, but I'm not sure how this one gets generated */
return INT2NUM(2);
}
else
{
return wrap_node(b->var);
}
}