Skip to content

Instantly share code, notes, and snippets.

@Murphydbuffalo
Created June 1, 2014 20:49
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 Murphydbuffalo/3d652c298e6cd3a57748 to your computer and use it in GitHub Desktop.
Save Murphydbuffalo/3d652c298e6cd3a57748 to your computer and use it in GitHub Desktop.
Solution to the constructors mini-challenge (OOD reading)
class Television # A TV plays many channels and many shows of those channels.
def initialize(channels=[])
@channels = channels
end
end
class Channels #A channel may have many shows and belong to many TVs.
def initialize(shows=[])
@shows = shows
end
end
class Shows#Shows belong to (potentially) many channels and play on many TVs
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment