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

- old
+ new

@@ -1,35 +1,15 @@ module Bearcat class Client < Footrest::Client module Enrollments + extend ClientModule - def user_enrollments(user, params={}) - get("/api/v1/users/#{user.to_s}/enrollments", params) - end - - def course_enrollments(course, params={}) - get("/api/v1/courses/#{course.to_s}/enrollments", params) - end - - def section_enrollments(section, params={}) - get("/api/v1/sections/#{section.to_s}/enrollments", params) - end - - def enroll_in_section(section, params={}) - post("/api/v1/sections/#{section.to_s}/enrollments", params) - end - - def enroll_in_course(course, params={}) - post("/api/v1/courses/#{course.to_s}/enrollments", params) - end - - def conclude_enrollment(course, enrollment, params={}) - delete("/api/v1/courses/#{course}/enrollments/#{enrollment}", params) - end - - def reactivate_enrollment(course, enrollment, params={}) - put("/api/v1/courses/#{course}/enrollments/#{enrollment}/reactivate", params) - end - + get :user_enrollments, "/api/v1/users/:user/enrollments" + get :course_enrollments, "/api/v1/courses/:course/enrollments" + get :section_enrollments, "/api/v1/sections/:section/enrollments" + post :enroll_in_section, "/api/v1/sections/:section/enrollments" + post :enroll_in_course, "/api/v1/courses/:course/enrollments" + delete :conclude_enrollment, "/api/v1/courses/:course/enrollments/:enrollment" + put :reactivate_enrollment, "/api/v1/courses/:course/enrollments/:enrollment/reactivate" end end end