Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created June 4, 2012 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonroelofs/2869306 to your computer and use it in GitHub Desktop.
Save jasonroelofs/2869306 to your computer and use it in GitHub Desktop.
class Driving
def start(car)
car.clone.merge(running: true)
end
def accelerate(car)
car.clone.merge(speed: car[:speed] + 1)
end
def get_in(car, passenger)
car.clone.merge(passengers: car[:passengers] + [passenger])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment