From: Intransition Date: 2011-06-25T05:09:01+09:00 Subject: Re: Honoring #to_ary and such On Jun 24, 3:57 pm, Jeremy Heiler wrote: > It depends. Do you want to? I suppose the only disadvantage would be > the cost of an object possibly creating a new array when to_ary is > invoked. No, I don't really ;-) But... I've always been under the impression that something that responds to #to_ary should be treated as such. Thanks to duck-typing I've never really had to give it much thought before. > It might be worth letting the user decide with a second `force = > false` parameter. > > I am also wondering, what makes a String special here as opposed to a > Fixnum or any other object? An example would be a path name. The real code actually goes a bit further to validate each element of the array too.