Refactored and added hit method to ship.rb