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

Explain ampersand parameter (&block) in Ruby?

1 Answers  


What does ruby name refers to?

1 Answers  


Explain next statement in ruby.

1 Answers  


Explain Ruby object?

1 Answers  


Do you know what is the defined operator?

1 Answers  


What is yield in ruby?

1 Answers  


Explain about Float, Dig and Max?

1 Answers  


Explain Ruby module?

1 Answers  


What is the difference between a statement and an expression in ruby?

1 Answers  


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

1 Answers  


How would you freeze an object in ruby?

1 Answers  


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

1 Answers  


Categories