In article <8FE83020B9E1A248A182A9B0A7B76E7358B105 / itomae2km07.AD.QINTRA.COM>, "Berger, Daniel" <Daniel.Berger / qwest.com> writes: >> For example, Pathname.new("a") + Pathname.new("b") is Pathname.new("a/b"), >> not Pathname.new("ab"). > > Then you redefine the methods that need it. Such redefinition violates the string behavior. It breaks "is-a" relation between Pathname and String. So, Pathname should not inherit String if such redefinition is required. > Then, IMHO, you should use duck-typing rather than checking the class > type. I use duck-typing, not checking the class. Inheriting Pathname from String makes duck-typing difficult because Pathname has String methods. > I don't follow. Can you provide an example? require 'pathname' require 'uri' def meth(x) puts x.read end meth(Pathname.new("...")) meth(URI("http://...")) > It looks like any method with a :nodoc: tag is meant to be private. Done. I made cleanpath_aggressive and cleanpath_conservative private. hash and inspect is not changed. -- Tanaka Akira