lib/cli.rb
# should have the list of songs from Scraper class
should have the list of songs from Scraper class
should have the list of songs from Scraper class
def list_of_songs
        puts "\n"
        rows = []
        Song.all.each do |song|  
            title = song.title
            artist = song.artist.name 
            ranking = song.ranking
            rows << [ranking, title, artist] 
        end 
        table = Terminal::Table.new :headings => ['Ranking', 'Song', 'Artist(s)'], :rows => rows  
        puts table
    end
def list_of_songs puts "\n" rows = [ ] Song . all . each do | song | title = song . title artist = song . artist . name ranking = song . ranking rows << [ ranking , title , artist ] end table = Terminal :: Table . new :headings => [ 'Ranking' , 'Song' , 'Artist(s)' ] , :rows => rows puts table end
should have the list of songs from Scraper class
should have the list of songs from Scraper class
# Expose the @@all class variable by calling the #all method on the Song class # #artist returns the object. Needs #name to output the value of @name accessor # returns array of arrays # end of do # be explicit