2008/4/17, Iki Baz Castillo <ibc / aliax.net>:
> Hi, is not possible to terminate the body of a "when" stament?
>
>  I mean:
>
>   case num
>   when 1:
>     puts "Is 1 !!!!"
>     break
>     puts "Don't write it"
>   end
>
>   puts "Write it"
>
>  but unfortunatelly the "break" gives an error.

break is only for iteration. What are you trying to do?
The example you've given is not a compelling use case,
since you can simply remove the line after break.

Also, Ruby's case/when doesn't fall through when clauses.

    case 1
    when 1
      puts "it's 1"
    when 2
      puts "this is not printed"
    end

Stefan