1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix the docs for Proc#>>.

The docs are wrong about the behaviour of `#>>` (looks like it was copied from `#<<`)
In `(prc >> g).call(n)` _prc_ is called first (with _n_), *then* _g_ is called with the result.

Code examples are OK.
This commit is contained in:
Paweł Przeniczny 2019-11-24 23:08:16 +01:00 committed by Nobuyoshi Nakada
parent fd956c72ea
commit ce50af21af
Notes: git 2019-11-25 09:19:39 +09:00

4
proc.c
View file

@ -3362,8 +3362,8 @@ rb_proc_compose_to_left(VALUE self, VALUE g)
* prc >> g -> a_proc
*
* Returns a proc that is the composition of this proc and the given <i>g</i>.
* The returned proc takes a variable number of arguments, calls <i>g</i> with them
* then calls this proc with the result.
* The returned proc takes a variable number of arguments, calls this proc with them
* then calls <i>g</i> with the result.
*
* f = proc {|x| x * x }
* g = proc {|x| x + x }