Created
April 6, 2020 01:37
-
-
Save rpdecks/780d44284409523226caf7460942b7be 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
def files | |
# I think I will need to create an array of file names here of the files whose data I want to import | |
@files = [] | |
Dir.entries(path).select do |file| | |
if !File.directory?(file) && file.end_with?(".mp3") | |
# why does if need to check file.directory? | |
@files << file | |
end | |
end | |
end | |
def import | |
# why not use @file here like we do in def files? | |
Song.new_by_filename(file) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment