Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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