Skip to content
instance method

Proc#<<

(::Proc::_Callable callable) -> ::Proc
prc << g → a_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.

Example
f = proc {|x| x * x }
g = proc {|x| x + x }
p (f << g).call(2) #=> 16

See Proc#>> for detailed explanations.

See also .new #== #=== also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0