Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Tell me what are blocks and procs?



Tell me what are blocks and procs?..

Answer / Ranjeet Kaur

In Ruby, a block is anonymous piece of code that can be passed around as an argument to methods. A Proc object (short for procedure) is a first-class function object that can be assigned to a variable, passed as an argument to other methods, and used to define default arguments. For example: `proc = Proc.new { puts 'Hello World' }; proc.call # outputs "Hello World"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Can you please explain what is the difference between string and symbol?

1 Answers  


what is the role of sub-directory app/controllers and app/helpers?

1 Answers  


What is the difference between throw/catch and raise/rescue?

1 Answers  


Explain Ruby module?

1 Answers  


Explain me what is the difference between symbol and string?

1 Answers  


Explain about variables?

1 Answers  


Tell me how symbol is different from variables?

1 Answers  


Why Ruby is known as a language of flexibility?

1 Answers  


What is ruby methods?

1 Answers  


Overview of ruby programming language?

1 Answers  


How would you implement hash in ruby internally?

1 Answers  


What is concatenating string in Ruby?

1 Answers  


Categories