Guest User

Untitled

a guest
Mar 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # frozen_string_literal: true
  2.  
  3. module Vehicle
  4. class Crasher
  5. def initialize(vehicle)
  6. @vehicle = vehicle
  7. end
  8.  
  9. def run
  10. return if vehicle.parked? || vehicle.stalled?
  11.  
  12. vehicle.update_attributes(state: 'stalled')
  13. end
  14. end
  15. end
Add Comment
Please, Sign In to add comment