Created
June 5, 2016 12:15
-
-
Save codesword/337b3a7216b90c8298e8a49e6df3349c 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
class RubyTrainingTeam | |
def train_new_fellow(name) | |
# Trains all new fellow in ruby track | |
end | |
end | |
class PythonTrainingTeam | |
def train_new_fellow(name) | |
# Trains all new fellowin python track | |
end | |
end | |
class PhpTrainingTeam | |
def train_new_fellow(name) | |
# Trains all new fellow in php track | |
end | |
end | |
class JavascriptTrainingTeam | |
def train_new_fellow(name) | |
# Trains all new fellow in javascript track | |
end | |
end | |
class JavaTrainingTeam | |
def train_new_fellow(name) | |
# Trains all new fellow in java track | |
end | |
end | |
class Director | |
def train_new_fellow(track, name) | |
team = Object.const_get("#{track}TrainingTeam").new | |
team.train_new_fellow(name) | |
end | |
end | |
director_of_training = Director.new | |
director_of_training.train_new_fellow("Ruby", "Aboki") # => trains Aboki in ruby track | |
director_of_training.train_new_fellow("Php", "Aboki Brother") # => trains Aboki Brother in php track |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment