what is the difference between Procs and Blocks?
Answer / Kalyan Kumar Yadav
Procs are objects that encapsulate a block of code, allowing it to be passed around as an object. Blocks, on the other hand, are anonymous methods defined within a method call. While blocks can be converted into Procs using the Proc#new method, not all Procs can be used as blocks.
| Is This Answer Correct ? | 0 Yes | 0 No |
Ruby support single inheritance/multiple inheritance or both?
what is the difference between String and Symbol?
Explain the types of variables available in ruby class?
How can you removed from array in ruby?
What things we can define in the model?
Does hash use “ #==” or “#eql?” To compare hash keys?
Explain the use of global variable $ in Ruby?
What is the use of load and require in ruby?
what is class libraries in Ruby?
Explain some of the looping structures available in ruby?
What is the pattern matching operator in ruby?
What are advantages of using ruby?