Last active
December 13, 2015 20:59
-
-
Save fellix/4974461 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 TvShow | |
def initialize | |
yield self if block_given? | |
end | |
def self.add(&block) | |
tv_show = TvShow.new(&block) | |
@@shows ||= [] | |
@@shows << tv_show | |
end | |
end | |
TvShow.add do |show| | |
show.name = "How I met your mother" | |
show.file_formats = ["avi", "mp4", "ogg"] | |
show.only_new_episodes = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment