Class: UnboundProc
Instance Method Summary collapse
-
#call ⇒ raises TypeError
Raises a TypeError; UnboundProc objects cannot be called.
-
#bind(Binding) ⇒ Proc
Bind an UnboundProc to a Binding.
-
#binding ⇒ raises TypeError
Raises a TypeError; UnboundProc objects have no binding.
-
#call ⇒ raises TypeError
Raises a TypeError; UnboundProc objects cannot be called.
Methods inherited from Proc
#<<, #_dump, _load, #argument_info, #arguments, #as_code, #as_expression, #body, #has_rest_arg, #push, #signature, #unbind, #var
Instance Method Details
#call ⇒ raises TypeError
Raises a TypeError; UnboundProc objects cannot be called.
292 293 294 295 |
# File 'ext/internal/proc/proc.c', line 292
static VALUE unboundproc_call(VALUE self, VALUE args)
{
rb_raise(rb_eTypeError, "you cannot call unbound proc; bind first");
}
|
#bind(Binding) ⇒ Proc
Bind an UnboundProc to a Binding. Returns a Proc that has been bound to the given binding.
272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'ext/internal/proc/proc.c', line 272
static VALUE unboundproc_bind(VALUE self, VALUE binding)
{
#ifdef RUBY_VM
rb_proc_t * p;
GetProcPtr(self, p);
return create_proc(rb_cProc, binding, p->block.iseq);
#else
struct BLOCK * b;
Data_Get_Struct(self, struct BLOCK, b);
/* create_proc will do a security check */
return create_proc(rb_cProc, binding, b->body, b->var);
#endif
}
|
#binding ⇒ raises TypeError
Raises a TypeError; UnboundProc objects have no binding.
303 304 305 306 |
# File 'ext/internal/proc/proc.c', line 303
static VALUE unboundproc_binding(VALUE self)
{
rb_raise(rb_eTypeError, "unbound proc has no binding");
}
|
#call ⇒ raises TypeError
Raises a TypeError; UnboundProc objects cannot be called.
292 293 294 295 |
# File 'ext/internal/proc/proc.c', line 292
static VALUE unboundproc_call(VALUE self, VALUE args)
{
rb_raise(rb_eTypeError, "you cannot call unbound proc; bind first");
}
|