Skip to content
instance method

Method#<<

(::Proc::_Callable g) -> ::Proc
self << g → a_proc

Returns a proc that is the composition of the given g and this method.

The returned proc takes a variable number of arguments. It first calls g with the arguments, then calls self with the return value of g.

Example
def f(ary) = ary << 'in f'

f = self.method(:f)
g = proc { |ary| ary << 'in proc' }
(f << g).call([]) # => ["in proc", "in f"]
See also #== #=== also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0