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

what the difference is between false and nil in Ruby?

1 Answers  


Please explain what are some advantages of using ruby?

1 Answers  


How many types of associations relationships does a model has?

1 Answers  


How do you handle exceptions in ruby code?

1 Answers  


Are numeric objects mutable in ruby?

1 Answers  


Explain until loop in ruby.

1 Answers  


How to open a file in Ruby?

1 Answers  


Explain how can we define ruby regular expressions?

1 Answers  


Explain for loop in Ruby?

1 Answers  


what is the Notation used for denoting class variables in Ruby?

1 Answers  


What are the ruby variables?

1 Answers  


How to create a new time instance in Ruby?

1 Answers  


Categories