Last active
July 26, 2019 11:26
-
-
Save nafidurmus/63d1be4d6a8311ec15f789923c592f67 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 Wand | |
def cast_spell | |
spell = get_new_spell | |
spell.cast! | |
end | |
def get_new_spell | |
raise "abstract method #get_new_spell must be defined" | |
end | |
end | |
class HarryPottersWand < Wand | |
def get_new_spell | |
WingardiumLeviosa.new | |
end | |
end | |
class SeverusSnapesWand < Wand | |
def get_new_spell | |
Crucio.new | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment