"Brian Candler" <B.Candler / pobox.com> schrieb im Newsbeitrag
news:20040930191318.GA932 / uk.tiscali.com...

> Let's factor out the variable, so we get
>
>   case object
>   when Proc.new(:===){|x| x.method == 'whatever' }
>     ... do stuff1
>   when Proc.new(:===){|x| x.id%2 == 0 }
>     ... do stuff2
>   end

This is inefficient.  Using a constant is more efficient and IMHO more
readable:

EVEN = Proc.new(:===){|x| x % 2 == 0 }

case foo
when EVEN
  ...
end

Kind regards

    robert