TODO: This page is still a fragment. Contributions welcome!
T.proc.params(arg0: Arg0Type, arg1: Arg2Type, ...).returns(ReturnType)
This is the type of a
Proc (such as a block passed to a method as a
parameter) that accepts arguments of types
Arg1Type, etc., and
At present, all parameters are assumed to be required positional parameters. We may add support for optional or keyword parameters in the future, if there is demand.
Types of procs are not checked at all at runtime (the same way methods are), and
serve only as hints to
srb statically (and for documentation).
Question: what do I put in my
params if I’m using
yield instead of
Answer: just add a new block parameter to your method definition. Ruby will
yield to the thing named by the
Use this when the block of the signature will be
instance_eval'd in a context other than the method definition’s