Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Method#>>

(::Proc::_Callable g) -> ::Proc
meth >> g → a_proc

Returns a proc that is the composition of this method and the given g. The returned proc takes a variable number of arguments, calls this method with them then calls g with the result.

Example
def f(x)
  x * x
end

f = self.method(:f)
g = proc {|x| x + x }
p (f >> g).call(2) #=> 8
See also #=== #[] #== #arity also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0