How are blocks created?



How are blocks created?..

Answer / Gagandeep

Blocks in Ruby are defined by enclosing a piece of code between `do...end` or within an indented line that follows the method definition. When a method is called with such block, it can be captured using the `&block_variable` syntax.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

How do rails implement ajax?

1 Answers  


How to find second max element from database ?

1 Answers  


What is a ruby singleton method ?

1 Answers  


What is the difference between delete and destroy ?

1 Answers  


what is Rails Active Record in Ruby on Rails?

1 Answers  


Explain me what is the purpose of rjs in rails?

1 Answers  


What is unit testing (in classical terms)? What is the primary technique when writing a test ?

1 Answers  


Whats the difference between symbol and string?

2 Answers  


Write a program to show the functionality of request.xhr in ruby on rails ?

1 Answers  


what is active record?

1 Answers  


What is the role of mvc architecture in ruby on rails?

1 Answers  


How many filters are there in rails.

1 Answers  


Categories