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 how can you declare a block in ruby?



Tell me how can you declare a block in ruby?..

Answer / Chandrakant Giri

A block in Ruby is defined using the curly braces `{}` or keywords do and end. It should be placed after a method call with a preceding semicolon (;) if it's not part of the method definition itself. For example:ntmy_method { # code here }nOr using do and end:ntmy_method {n# code heren}n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

What is the scope of a local variable in ruby?

1 Answers  


What are some built-in ruby class exceptions.

1 Answers  


what the difference is between false and nil in Ruby?

1 Answers  


What does irb stand for?

1 Answers  


What method might you use to remove duplicate values from an array?

1 Answers  


Is ruby a statically typed or a dynamically typed language?

1 Answers  


Explain each of the following operators and how and when they should be used: ==, ===, eql?, Equal?

1 Answers  


what is the purpose of the rakefile available in the demo directory in ruby?

1 Answers  


Explain the difference between a single quote and double quote?

1 Answers  


How to use sql db or mysql db. Without defining it in the database.yml

1 Answers  


Tell me what are blocks and procs?

1 Answers  


Tell us what is the difference between dynamic and static scaffolding?

1 Answers  


Categories