From: Tim Bates Date: 2003-03-27T13:22:54+09:00 Subject: Re: case not calling class' '===' method? On Thu, 27 Mar 2003 2:41 pm, Phil Tomson wrote: > maybe I'm missing something obvious... Case uses the === operator the opposite way around to what you might expect. irb(main):001:0> "myString" === /my/ false irb(main):002:0> /my/ === "myString" 0 irb(main):003:0> case "myString" irb(main):004:1> when /my/ irb(main):005:1> true irb(main):006:1> end true irb(main):007:0> case /my/ irb(main):008:1> when "myString" irb(main):009:1> true irb(main):010:1> end nil In the example of case "myString" when /my/ true end Ruby actually calls Regexp#===, not String#=== Tim Bates -- tim@bates.id.au