Quantcast
Channel: is_a? vs respond_to? - Code Review Stack Exchange
Browsing all 2 articles
Browse latest View live

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 Article



is_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
Browsing all 2 articles
Browse latest View live




Latest Images