foo(&a_proc_object)
turns a_proc_object
into a block and calls foo with that block.
foo(¬_a_proc_object)
calls to_proc
on not_a_proc_object
and then turns the proc object returned by to_proc
into a block and calls foo with that block.
In ruby 1.8.7+ and active support Symbol#to_proc
is defined to return a proc which calls the method named by the symbol on the argument to the proc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…