Created
October 19, 2010 03:37
-
-
Save Whoops/633562 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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