Sha256: 84466ac1eba0299f9f969b0369cf7e92bc0ac9f607d528ba9ea9fdbb6ddfe2c0

Contents?: true

Size: 884 Bytes

Versions: 5

Compression:

Stored size: 884 Bytes

Contents

module Bearcat
  class Client < Footrest::Client
    module Courses

      def course(course, params={})
        get("/api/v1/courses/#{course}", params)
      end

      def create_course(account_id, params={})
        post("/api/v1/accounts/#{account_id}/courses", params)
      end

      def update_course(course, params={})
        put("/api/v1/courses/#{course}", params)
      end

      def list_course_users(course, params={})
        get("/api/v1/courses/#{course}/users", params)
      end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bearcat-1.0.2 lib/bearcat/client/courses.rb
bearcat-1.0.1 lib/bearcat/client/courses.rb
bearcat-1.0.0 lib/bearcat/client/courses.rb
bearcat-0.9.22 lib/bearcat/client/courses.rb
bearcat-0.9.20 lib/bearcat/client/courses.rb