I'm building my OO skills (about 30 years late) and am learning a little bit about patterns. While they may not be the be all and end all, my current use case might be a good fit for the Adapter. Looking for a little wisdom before I jump in.
I have a module, "data_mine", currently with two methods. "get_random_line_from_file" returns a string from a file, and it uses "array_from_file" to intake a line delimited file of possible data options.
The goal is to change the "get" method so it can take an optional positive integer and return that many items, and for the source of data to be either a line based file, a CSV file, a MongoDB or SQLite datastore, etc.
Is the Adapter pattern a good fit for this refactoring?