`Integer(id) && :id rescue :name`, but I'm not sure that's any more readable.