Method: Proc#push

Defined in:
ext/internal/proc/proc.c

#push(anotherProc) ⇒ self

Append the body of anotherProc onto proc.

Returns:

  • (self)


251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'ext/internal/proc/proc.c', line 251

static VALUE proc_push(VALUE self, VALUE other)
{
#ifdef RUBY_VM
  rb_raise(rb_eRuntimeError, "Proc#push not implemented yet for YARV");
#else
  struct BLOCK * b1;
  struct BLOCK * b2;
  Data_Get_Struct(self, struct BLOCK, b1);
  Data_Get_Struct(other, struct BLOCK, b2);
  b1->body = NEW_NODE(NODE_BLOCK, b1->body, 0, b2->body);
  return self;
#endif
}