Method: Proc#<<
- Defined in:
- proc.c
#<<(g) ⇒ Proc
Returns a proc that is the composition of this proc and the given g. The returned proc takes a variable number of arguments, calls g with them then calls this proc with the result.
f = proc {|x| x * x }
g = proc {|x| x + x }
p (f << g).call(2) #=> 16
See Proc#>> for detailed explanations.
3366 3367 3368 3369 3370 |
# File 'proc.c', line 3366
static VALUE
proc_compose_to_left(VALUE self, VALUE g)
{
return rb_proc_compose_to_left(self, to_callable(g));
}
|