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

- old
+ new

@@ -1,50 +1,26 @@ module Bearcat class Client < Footrest::Client module Assignments + extend ClientModule - def assignments(course, params={}) - get("/api/v1/courses/#{course}/assignments", params) - end + prefix "/api/v1/courses/:course/assignments/" do + get :assignments, "" + post :create_assignment, "" - def assignment(course, assignment, params={}) - get("/api/v1/courses/#{course}/assignments/#{assignment}", params) - end + get :all_assignment_overrides, "overrides" + post :batch_create_assignment_overrides, "overrides" + put :batch_update_assignment_overrides, "overrides" - def assignment_overrides(course, assignment) - get("/api/v1/courses/#{course}/assignments/#{assignment}/overrides") - end + prefix ":assignment/" do + get :assignment + put :edit_assignment + delete :delete_assignment - def all_assignment_overrides(course_id) - get("/api/v1/courses/#{course_id}/assignments/overrides") - end - - def create_assignment_override(course, assignment, params) - post("api/v1/courses/#{course}/assignments/#{assignment}/overrides", params) - end - - def delete_assignment_override(course_id, assignment_id, override_id, params={}) - delete("api/v1/courses/#{course_id}/assignments/#{assignment_id}/overrides/#{override_id}", params) - end - - def batch_create_assignment_overrides(course_id, params) - post("/api/v1/courses/#{course_id}/assignments/overrides", params) - end - - def batch_update_assignment_overrides(course_id, params) - put("/api/v1/courses/#{course_id}/assignments/overrides", params) - end - - def create_assignment(course, params={}) - post("/api/v1/courses/#{course}/assignments", params) - end - - def edit_assignment(course, assignment, params={}) - put("/api/v1/courses/#{course}/assignments/#{assignment}", params) - end - - def delete_assignment(course, assignment) - delete("/api/v1/courses/#{course}/assignments/#{assignment}") + get :assignment_overrides, "overrides" + post :create_assignment_override, "overrides" + delete :delete_assignment_override, "overrides/:override" + end end end end end