On Thu, 2008-01-31 at 20:52 +0900, Remco Hh wrote:
> nowadays i try to improve my coding style to produce nicer and beter
> readable code. I try to improve the following code but i dont know how.
> 
> if condtion1
>       x=1
>     else
>       if condition2
>          x=2
>       else
>          if condition3
>            x=3
>         end
>       end
>       x=nill
>   end
> 
> there are three different conditions which can not occur at the same
> time
> can i make this nicer?

http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#S5

HTH,

Felix