What is the main difference between procs and blocks?
Answer / Chandra Bhan Singh
In Ruby, Procs (procedure objects) are self-contained chunks of code that can be passed around and executed on demand. They can capture the state of the local variables when defined. On the other hand, Blocks are pieces of code written inside methods or within Proc literals. Blocks are used to pass code as arguments.
| Is This Answer Correct ? | 0 Yes | 0 No |
ruby on rails and java ,which of one of the best in future &present?
What is rails script? Name some of them?
Tell me what is mixin in rails?
Write a program to generate and run the application without the use of database
write a program to show the usage of sql in the database file?
what is Rails Migration?
what is the defined operator?
What is the main function of helpers used in ruby on rails?
Do you know what is rake in rails?
what is the difference between new, save and create?
Mention the role of rails controller.
What are filters? and how many types of filters are there in ruby