Skip to content

Instantly share code, notes, and snippets.

@Whoops
Created October 19, 2010 03:37
Show Gist options
  • Save Whoops/633562 to your computer and use it in GitHub Desktop.
Save Whoops/633562 to your computer and use it in GitHub Desktop.
module Drive
def go
start_engine
plan_route
follow_route
end
def start_engine
#code here
end
def follow_route
#code here
end
end
class Gym < Drive
def plan_route
#code to find route to gym
end
end
class Grocery < Drive
def plan_route
#code to find route to grocery
end
end
Gym.new.go #goes to gym
Grocery.new.go #goes to grocery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment