Hi all

I'm looking further into Ruby, and I'm wondering about case (switch) statements.

In PHP, its possible to do the following:
PHP Code:
switch(true)
  {
      case 
is_object($myvar):
      
// do something
      
break;
      case 
is_array($myvar):
      
// do something
       
break;
      case 
is_scalar($myvar):
      
// do something
       
break;
      default:
      break;
  } 
So rather than evaluating case value against switch value, I'm evaluating case expression against switch value.

Can I do the same in Ruby?

Also, are there any other useful quirks in Ruby's syntax that people can take advantage of?