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 |
what is the difference between a gem and a plugin in Ruby?
What is RubyGems in Ruby programming language?
What are the data types in ruby?
What is the use of global variable $ in Ruby?
Explain about the command line options?
Tell us what is class libraries in ruby?
In how many ways items can be added in an array in Ruby?
How is class methods defined in ruby?
How symbol is different from variables?
How do you handle exceptions in ruby code?
What are the different uses of ruby modules?
What is retry statement in ruby?