Module: Bearcat::Client::Courses

Extended by:
ClientModule
Defined in:
lib/bearcat/client/courses.rb

Constant Summary

Constants included from ClientModule

Bearcat::Client::ClientModule::ARG_REGEX

Instance Attribute Summary

Attributes included from ClientModule

#_registered_endpoints

Instance Method Summary collapse

Methods included from ClientModule

context_types, endpoint, prefix

Instance Method Details

#create_content_migration(course, file_path, params = {}) ⇒ Object



34
35
36
37
# File 'lib/bearcat/client/courses.rb', line 34

def create_content_migration(course, file_path, params={})
  content_migration_response, file_upload_response = create_content_migration_with_both_responses(course, file_path, params)
  file_upload_response
end

#create_content_migration_with_both_responses(course, file_path, params = {}) ⇒ Object



27
28
29
30
31
32
# File 'lib/bearcat/client/courses.rb', line 27

def create_content_migration_with_both_responses(course, file_path, params={})
  content_migration_response = post("/api/v1/courses/#{course}/content_migrations", params)
  pre_attachment = content_migration_response['pre_attachment']
  confirmation_url = post_file(pre_attachment['upload_url'], pre_attachment['upload_params'], file_path)
  [content_migration_response, confirm_file_upload(confirmation_url)]
end