Added to_path method to the allowed methods in constructor

This allows to pass a Pathname object to the constructor