Challenge 1: A Custom Enumerable Class — Solution class Playlist include Enumerable def initialize @songs = [] end def add(song) @songs << song self end def each @songs.each { |song| yield song } end end playlist = Playlist.new playlist.add("Bohemian Rhapsody") .add("Stairway to Heaven") .add("Hotel California") .add("Sweet Child O' Mine") .add("Purple Rain") matches = playlist.select { |song| song.include?("Heaven") } puts matches.inspect puts playlist.count =begin Output: ["Stairway to Heaven"] 5 Notes: - Playlist only defines each, which yields every element of the internal @songs array one at a time. - .select and .count are never defined anywhere in Playlist — both come entirely from include Enumerable, driven by the each method above. - add returns self at the end, which is what makes chaining .add(...).add(...).add(...) possible in the setup code. =end