Answer by vgoff for is_a? vs respond_to?
Given that on some file systems a directory is simply a File with special attributes (or to put it another way a specialized file), does it really matter? Unlink it if it can be unlinked if that is...
View Articleis_a? vs respond_to?
I am working on some code which checks whether or not to unlink a file on the basis of the class:File.unlink(file.path) if file.is_a? FileI think it would be more idiomatic to check whether the object...
View Article
More Pages to Explore .....