Topic: Proc === method

So the Proc documentation says:

prc === obj → result_of_proc

Invokes the block, with obj as the block‘s parameter. It is to allow a proc object to be a target of when clause in the case statement.

and I wanted to test this out:

case Proc.new { "hello"}
when "hello"
  puts "greeting received"
else
  puts "some other message"
end

But I get "some other message"... I thought it is saying the Proc will be called when it's used with a case statement? Am I misunderstanding the documentation? 

-patrick

Re: Proc === method

Target of a when clause!

h = Proc.new {"hello"}

case "hello"
when h
  puts "greeting received"
else
  puts "some other message"
end

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Proc === method

ahhhhhhhhhhh!!!!!!!!

-patrick