Bug #42 [ruby-reference-manual:818]
Pathname.new の説明
| Status : | Open | Start : | 02/13/2008 | |
| Priority : | Low | Due date : | ||
| Assigned to : | - | % Done : | 0% |
|
| Category : | doc | |||
| Target version : | - | |||
| reporter : | rock |
ruby_version : | 1.8,1.9 |
|
Description
Pathname.new において,引数が文字列であるという前提で書かれていますが, 実際には Pathname オブジェクトなど to_str できるものなら何でもいいので, それを書いたほうがいいと思います。 とくに,文字列だか Pathname オブジェクトだか分からないものを受け取って, Pathname オブジェクトとして扱うメソッドの中で Pathname.new(引数) と書いてよいということを知るために。 Kernel#Pathname も。