`if ! file.is_a?(Fog::Storage::Rackspace::File) && object` should be equivalent.  I don't know if you were looking for short-circuiting behavior on the file check.  If not, then moving the object check to the front would be better since the nil check will fail faster.