From: Gary Wright Date: 2010-01-28T08:45:10+09:00 Subject: Re: Class with Multi Constrcutor ( initialize ) On Jan 27, 2010, at 4:14 PM, Albert Schlef wrote: > Robert Klemme wrote: >> A solution like this was proposed for overloading once but it does not >> seem to be widely used: >> >> irb(main):001:0> def overload(*a) >> irb(main):002:1> case a.map {|x|x.class} >> irb(main):003:2> when [String] >> irb(main):004:2> puts "a single string" >> irb(main):005:2> when [Fixnum, String] > > Cool. Where is "Array#===" documented? I couldn't find it. Unfortunately Array#=== is just the same as Array#==, which is why the argument list is mapped to class objects via #map in that example from Robert. There was a somewhat recent thread about changing Array#=== to be an element-wise application of ===, which makes a lot of sense to me. Gary Wright