Last active
May 5, 2018 21:33
-
-
Save MostlyFocusedMike/b886d54eeb49318f0896ecb3aab5d2c6 to your computer and use it in GitHub Desktop.
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 StandUp |class Club | |
| | |
attr_accessor :name | attr_accessor :club_name | |
| | |
@@all = [] | @@all = [] | |
| | |
def initialize(name) | def initialize(club_name) | |
@name = name | @club_name = club_name | |
@@all << self | @@all << self | |
end | end | |
| | |
def self.all | def self.all | |
@@all | @@all | |
end | end | |
| | |
def all_shows_performed | def all_shows_at_club | |
Show.all.select do |show| | Show.all.select do |show| | |
show.stand_up == self | show.club == self | |
end | end | |
end | end | |
| | |
def all_clubs | def all_stand_ups | |
self.all_shows_performed.map do |show| | self.all_shows_at_club.map do |show| | |
show.club | show.stand_up | |
end.uniq | end | |
end | end | |
end |end | |
| |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment