From: Masaki Suketa Date: 2006-10-01T06:59:03+09:00 Subject: Re: Enumerable and WIN32OLE Hello, In message "Re: Enumerable and WIN32OLE" on 06/10/01, Dave Burt writes: > > Some Enumerable's methods does not need a block, for example, Enumerable#max. > > So, I hesitate to implement your idea. > > (I am not sure that there are OLE methods whose name is "max".) > > I had an earlier version of the code I posted that went through > Enumerable.instance_methods but skipped specific methods that don't need > blocks (min, max, to_a, entries, grep, sort, zip, /enum_.*/, /.*\?$/). > You can probably dismiss this option as well as what I wrote, just for > being so inconsistent. I don't prefer this option, but I think it does > strike a valuable balance between POLS and compatibility. I think I understand your code skip the methods that don't need blocks. But, for example, if there is an OLE methods whose name is "max", then, I am afraid that we might have the same problem. Which method does the following code call (in your posted code)? OLE method max or Enumerable#max? ole = WIN32OLE.new(...) ole.max Do I misunderstand you? > Looking at where String's going in Ruby (apparently becoming > non-Enumerable in 1.9) another option could be to leave Enumerable out > of WIN32OLE itself, but provide an enum method to return an enumerator > object: > > class WIN32OLE > def enum > Enumerable::Enumerator.new(self) > end > end Hmm, please give me some time to investigate it. (If there is OLE "enum" method, I think we might have the same problem ...) Regards, Masaki Suketa