Created
June 5, 2016 12:13
-
-
Save codesword/d7f9901fa36ddbfe2620b462571f6bf0 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 TrainingTeam | |
def train_new_fellow(name) | |
# Trains all new fellow | |
end | |
def training_period(fellow_name) | |
# Returns the period the fellow has been in training | |
end | |
end | |
class Director | |
def initialize | |
@traing_team = TrainingTeam.new | |
end | |
def method_missing(method, *args) | |
if /train.*/ ~= method | |
@training_team.send(method, *args) | |
else | |
super | |
end | |
end | |
end | |
director_of_training = Director.new | |
director_of_training.train_new_fellow("Aboki") # => trains aboki for six months | |
director_of_training.training_period("Aboki") # => returns the period `Aboki` has been in training |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment