Skip to content

Instantly share code, notes, and snippets.

@Sihui
Last active July 20, 2017 04:26
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 Sihui/7002cf9ba66dbf638de523523d26c00e to your computer and use it in GitHub Desktop.
Save Sihui/7002cf9ba66dbf638de523523d26c00e to your computer and use it in GitHub Desktop.
Design Pattern: Observer and Podcasts
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