Gavin Sinclair wrote:

>>>    def test( obj )
>>>        case obj
>>>           when Array then puts "Array"
>>>           when Hash  then puts "Hash"
>>>           when Class then puts "Class"
>>>           else puts "ugh"
>>>        end
>>>    end
>>>      
>>>
>>How about
>>
>>def test(obj)
>>	if [Array, Hash, Class].include?(obj.class) then
>>		puts obj.class.to_s
>>	else
>>		puts "ugh"
>>	end
>>end
>>
>>I suspect that the case statement may be faster.
>>
>>    
>>
>
>How about
>
>  def test(obj)
>    puts \
>      case obj
>      when Array, Hash, Class then obj.class
>      else; "ugh"
>      end
>  end
>
>?
>
>Gavin
>  
>

Very nice, but why the ';' after 'else'?  Works with and without for me.

Michael