instance method
Method#>>
(::Proc::_Callable g) -> ::Proc
self >> g → a_proc
proc.c
View on GitHub ↗
static VALUE
rb_method_compose_to_right(VALUE self, VALUE g)
{
g = to_callable(g);
self = method_to_proc(self);
return proc_compose_to_right(self, g);
}
Returns a proc that is the composition of this method and the given g.
The returned proc takes a variable number of arguments. It first calls self with the arguments, then calls g with the return value of self.
Example
def f(ary) = ary << 'in f' f = self.method(:f) g = proc { |ary| ary << 'in proc' } (f >> g).call([]) # => ["in f", "in proc"]