<div dir="ltr">FYI, Ruby's Pathname class doesn't inherit String.<div><br></div><div><a href="http://ruby-doc.org/stdlib-2.1.0/libdoc/pathname/rdoc/Pathname.html">http://ruby-doc.org/stdlib-2.1.0/libdoc/pathname/rdoc/Pathname.html</a></div><div><br></div><div>Ruby has two "convert to string" method.</div><div>`.to_s` is like `__str__`.</div><div>`.to_str` is like `__index__` but for str.  It is used for implicit conversion.</div><div><br></div><div>File.open accepts any object implements `.to_str`.</div></div>