Created
July 20, 2017 04:27
-
-
Save Sihui/f7012839c6b5679e9f8d481950fc9db2 to your computer and use it in GitHub Desktop.
Design Pattern: Observer and Podcasts
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 Podcast | |
attr_reader :episodes | |
def initialize() | |
@episodes = [] | |
end | |
def add_episode(new_episode, sihui) | |
episodes << new_episode | |
sihui.update(self) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment