Last active
July 20, 2017 04:26
-
-
Save Sihui/7002cf9ba66dbf638de523523d26c00e 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) | |
episodes << new_episode | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment