Proc versus Method - Why?


#1

Hello,

I don't understand why using a proc instead of a method (or vice-versa).
Is there instances where both can be used indifferently? And instances where only a method or a proc should be used?

Is it maybe just a question of optimising the code?

I understand why using a proc instead of a block, but that doesn't help me to understand why not to use a method.

Thanks for your help!
L.

#2

https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Method_Calls


#3

@laurage,
Some
== discussions / opinions ==
http://stackoverflow.com/questions/9761825/why-use-procs-instead-of-methods
http://stackoverflow.com/questions/626/when-to-use-lambda-when-to-use-proc-new