Skip to content

Instantly share code, notes, and snippets.

@rpdecks
Created April 6, 2020 01:37
Show Gist options
  • Save rpdecks/780d44284409523226caf7460942b7be to your computer and use it in GitHub Desktop.
Save rpdecks/780d44284409523226caf7460942b7be to your computer and use it in GitHub Desktop.
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