Re: File.join oddity ?

From: ts <decoux@...>
Date: 2004-04-26 16:50:57 UTC
List: ruby-core #2821
>>>>> "J" == Johan Holmberg <holmberg@iar.se> writes:

J> Why does File.join have this extra complexity ?
J> If this is considered a "feature" I think it should at least be
J> documented.

 Well, I don't know the real reason, but File::join take an Array as
 argument. 

 Now when it iterate on each element of the Array, it has 3 case
   * it has a String ==> this give the result
   * it has an Array ==> it call recursively ::join
   * else it to call #to_s

 There are other methods which work like this.


Guy Decoux





In This Thread

Prev Next