When calling a method in Ruby, all parameters are necessary. You can't define a method that takes a parameter and then call it without one. In addition, if a method is defined to accept only one parameter, it will throw an error if it is called with multiple arguments.
A block is made up of code chunks.
You give a block a name.
In the block, the code is always contained in braces ().
A block is always called from a function that has the same name as it.
Share a personalized message with your friends.