lib/bearcat/client/blueprint_courses.rb in bearcat-1.4.13 vs lib/bearcat/client/blueprint_courses.rb in bearcat-1.5.0.beta1

- old
+ new

@@ -1,31 +1,25 @@ module Bearcat class Client < Footrest::Client module BlueprintCourses + extend ClientModule - # Get blueprint information - # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.show - def blueprint_template(course, template_id='default') - get("/api/v1/courses/#{course}/blueprint_templates/#{template_id}") - end + prefix "/api/v1/courses/:course/" do + # Get blueprint information + # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.show + get :blueprint_template, "blueprint_templates/:template_id", defaults: { template_id: 'default' } - # List blueprint subscriptions - # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.subscriptions_index - def blueprint_subscriptions(course) - get("/api/v1/courses/#{course}/blueprint_subscriptions") - end + # List blueprint subscriptions + # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.subscriptions_index + get :blueprint_subscriptions, "blueprint_subscriptions" - # Update associated courses - # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.update_associations - def blueprint_update_associations(course, template_id='default', params={}) - put("/api/v1/courses/#{course}/blueprint_templates/#{template_id}/update_associations", params) - end + # Update associated courses + # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.update_associations + put :blueprint_update_associations, "blueprint_templates/:template_id/update_associations", defaults: { template_id: 'default' } - # Begin a migration to push to associated courses - # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.queue_migration - def start_blueprint_migration(course, template_id='default', params={}) - post("/api/v1/courses/#{course}/blueprint_templates/#{template_id}/migrations", params) + # Begin a migration to push to associated courses + # https://canvas.instructure.com/doc/api/blueprint_courses.html#method.master_courses/master_templates.queue_migration + post :start_blueprint_migration, "blueprint_templates/:template_id/migrations", defaults: { template_id: 'default' } end - end end end