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...


Explain case statement in Ruby?



Explain case statement in Ruby?..

Answer / Mohd Wamick

The case statement in Ruby is similar to the switch statement in other programming languages. It allows you to execute different blocks of code based on the value of an expression. The basic structure is as follows:n```rubyncase expressionnwhen value1n # code block for when the expression matches value1nwhen value2n # code block for when the expression matches value2n...nelse n # code block for all other casesnend``

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

What are some built-in ruby class exceptions.

1 Answers  


What must you do first before you can invoke an unboundmethod object?

1 Answers  


Explain until loop in ruby.

1 Answers  


Explain the three levels of access control for ruby methods?

1 Answers  


What is the difference between ruby 1.9 and ruby 2.0?

1 Answers  


Tell me how you can create a controller for subject?

1 Answers  


What is rvm?

1 Answers  


In how many ways you can compare Ruby string?

1 Answers  


Explain about class libraries in ruby?

1 Answers  


Tell me how you define instance variable, global variable and class variable in ruby?

1 Answers  


Explain the use of ensure statement in Ruby?

1 Answers  


Explain about environment variables present in ruby?

1 Answers  


Categories