joshuadbaker / oo-jukebox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tags languages resources
oop
ruby
2

Object Oriented Jukebox

jukebox drawing

Description

In this lab, you'll be writing an Object Oriented Jukebox, with similar functionality to the first CLI Jukebox you built: it will introduce itself to the user and ask for input, and users should be able to ask for help, list available songs, play a song, and exit the program, all from the command line.

Instructions

Take a look at bin/jukebox. This executable file is run by typing ruby bin/jukebox. Note that the file requires lib/jukebox.rb. Your Jukebox class should accept a list of songs upon initialization, and jukebox instances should respond to a call method.

songs = [
  "Phoenix - 1901",
  "Tokyo Police Club - Wait Up",
  "Sufjan Stevens - Too Much",
  "The Naked and the Famous - Young Blood",
  "(Far From) Home - Tiga",
  "The Cults - Abducted",
  "Phoenix - Consolation Prizes",
  "Harry Chapman - Cats in the Cradle",
  "Amos Lee - Keep It Loose, Keep It Tight"
]

jukebox = Jukebox.new(songs)
jukebox.call

After that, your program should wait for input and respond to the following commands:

  1. help - Lists all commands a user can type.
  2. list - Lists all of the songs.
  3. play - Can be called in two different ways:
  • a user can type play, and then after being prompted again, type the name of a song or its number (when listed).
  • a user can type play <song_name/song_number> and the song will play.
  1. exit - This exists the program.

Make the tests in spec/jukebox_spec.rb pass!

About

License:Other


Languages

Language:Ruby 100.0%