Skip to content

Instantly share code, notes, and snippets.

@codesword
Created June 5, 2016 12:15
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 codesword/337b3a7216b90c8298e8a49e6df3349c to your computer and use it in GitHub Desktop.
Save codesword/337b3a7216b90c8298e8a49e6df3349c to your computer and use it in GitHub Desktop.
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