lib/todoist/misc/templates.rb in todoist-ruby-0.1.3 vs lib/todoist/misc/templates.rb in todoist-ruby-0.2.1

- old
+ new

@@ -1,29 +1,29 @@ module Todoist module Misc - class Templates + class Templates < Todoist::Service include Todoist::Util # Given a project and a File object (Ruby) imports the content onto the # server. Critically, if the file is a CSV file make sure that the # suffix is CSV. Otherwise, the file will be parsed as one item per line # and ignore the formatting altogether. def import_into_project(project, file) - multipart_file = NetworkHelper.multipart_file(file) + multipart_file = @client.api_helper.multipart_file(file) params = {project_id: project.id, file: multipart_file} - NetworkHelper.getMultipartResponse(Config::TODOIST_TEMPLATES_IMPORT_INTO_PROJECT_COMMAND, params) + @client.api_helper.get_multipart_response(Config::TODOIST_TEMPLATES_IMPORT_INTO_PROJECT_COMMAND, params) end # Export the project as a CSV string def export_as_file(project) params = {project_id: project.id} - NetworkHelper.getResponse(Config::TODOIST_TEMPLATES_EXPORT_AS_FILE_COMMAND, params) + @client.api_helper.get_response(Config::TODOIST_TEMPLATES_EXPORT_AS_FILE_COMMAND, params) end # Export the project as a url that can be accessed over HTTP def export_as_url(project) params = {project_id: project.id} - NetworkHelper.getResponse(Config::TODOIST_TEMPLATES_EXPORT_AS_URL_COMMAND, params) + @client.api_helper.get_response(Config::TODOIST_TEMPLATES_EXPORT_AS_URL_COMMAND, params) end end end end