<commit_before># Create a Playlist from Driver Code

# I worked on this challenge [with: <NAME>].
# I spent [2] hours on this challenge.


# Pseudocode



# Initial Solution
class Song
	attr_accessor :song
	attr_accessor :artist

		def initialize(song, artist)
			@song = song
			@artist = artist
		end
		def play
			p "#{@song} is playing"
		end
		
	end

class Playlist

	def initialize(*tune)
		@playlist = []
		 tune.each{ |tune| @playlist.push(tune.song)}
	end
	def add(*tune)
		tune.each {|tune| @playlist.push(tune.song)}
		p @playlist
	end
	def num_of_tracks
		@playlist.length
	end
	def remove(tune)
		@playlist.delete(tune.song)
		p @playlist
	end
	def includes?(tune)
		@playlist.include?(tune.song)
	end
	def play_all
		@playlist.each{|tune| p "#{tune} is playing"}
	end
	def display
		@playlist.each{|tune| puts tune}
	end
end

# Refactored Solution






# DRIVER CODE AND TESTS GO BELOW THIS LINE
one_by_one = Song.new("One by One", "Sirenia")
world_so_cold = Song.new("World So Cold", "Three Days Grace")
going_under = Song.new("Going Under", "Evanescence")

my_playlist = Playlist.new(one_by_one, world_so_cold, going_under)
lying_from_you = Song.new("Lying From You", "Linkin Park")
angels = Song.new("Angels", "Within Temptation")

my_playlist.add(lying_from_you, angels)
p my_playlist.num_of_tracks == 5
going_under.play #How would you model a song getting "played" in Ruby? I used `puts` and `sleep`. You can model this however you want.
my_playlist.remove(angels)
p my_playlist.includes?(lying_from_you) == true
my_playlist.play_all
my_playlist.display





# Reflection<commit_msg>Update ruby-review.rb<commit_after># Create a Playlist from Driver Code

# I worked on this challenge [with: <NAME>].
# I spent [2] hours on this challenge.


# Pseudocode



# Initial Solution
class Song
	attr_accessor :song
	attr_accessor :artist

		def initialize(song, artist)
			@song = song
			@artist = artist
		end
		def play
			p "#{@song} is playing"
		end
		
	end

class Playlist

	def initialize(*tune)
		@playlist = []
		 tune.each{ |tune| @playlist.push(tune.song)}
	end
	def add(*tune)
		tune.each {|tune| @playlist.push(tune.song)}
		p @playlist
	end
	def num_of_tracks
		@playlist.length
	end
	def remove(tune)
		@playlist.delete(tune.song)
		p @playlist
	end
	def includes?(tune)
		@playlist.include?(tune.song)
	end
	def play_all
		@playlist.each{|tune| p "#{tune} is playing"}
	end
	def display
		@playlist.each{|tune| puts tune}
	end
end

# Refactored Solution






# DRIVER CODE AND TESTS GO BELOW THIS LINE
one_by_one = Song.new("One by One", "Sirenia")
world_so_cold = Song.new("World So Cold", "Three Days Grace")
going_under = Song.new("Going Under", "Evanescence")

my_playlist = Playlist.new(one_by_one, world_so_cold, going_under)
lying_from_you = Song.new("Lying From You", "Linkin Park")
angels = Song.new("Angels", "Within Temptation")

my_playlist.add(lying_from_you, angels)
p my_playlist.num_of_tracks == 5
going_under.play #How would you model a song getting "played" in Ruby? I used `puts` and `sleep`. You can model this however you want.
my_playlist.remove(angels)
p my_playlist.includes?(lying_from_you) == true
my_playlist.play_all
my_playlist.display





# Reflection

# What concepts did you review in this challenge?
# 	creating ruby classes and passing information between classes
# What is still confusing to you about Ruby?
# 	need to review how to access class values outside of its class
# What are you going to study to get more prepared for Phase 1?
# 	study more ruby methods

{'fraction_non_alphanumeric': 0.10614208887630909, 'fraction_numerical': 0.001415227851684121, 'mean_word_length': 4.3545454545454545, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4721629', 'n_tokens_mistral': 1390, 'n_tokens_neox': 1268, 'n_words': 387}