TIL in Ruby: `arity`

Published on October 09, 2022
Returns the number of mandatory arguments.
If the block is declared to take no arguments, returns 0.
If the block is known to take exactly n arguments, returns n.
If the block has optional arguments, returns -n-1


https://apidock.com/ruby/Proc/arity

arity method in ruby