Updating Ruby code to write to a file and create method to return the main class. Currently absolute path is set.