I have a RemoteFile
that inherits from Pathname
class RemoteFile < Pathname
end
I create a remote file, and get its parent
irb> RemoteFile.new('.')
=> #<RemoteFile:.>
irb> RemoteFile.new('.').parent
=> #<Pathname:..>
Is there any way to get Pathname to return RemoteFiles besides monkey-patching a dozen methods in Pathname? Wouldn't it work better if Pathname returned objects of type self.class.new
?