lib/bearcat/client/reports.rb in bearcat-1.4.13 vs lib/bearcat/client/reports.rb in bearcat-1.5.0.beta1
- old
+ new
@@ -1,28 +1,17 @@
require 'csv'
module Bearcat
class Client < Footrest::Client
module Reports
+ extend ClientModule
- def report_list(account)
- get("/api/v1/accounts/#{account}/reports")
- end
-
- def start_report(account, report_name, params = {})
- post("/api/v1/accounts/#{account}/reports/#{report_name}", params)
- end
-
- def report_history(account, report_name)
- get("/api/v1/accounts/#{account}/reports/#{report_name}")
- end
-
- def report_status(account, report_name, report_id)
- get("/api/v1/accounts/#{account}/reports/#{report_name}/#{report_id}")
- end
-
- def delete_report(account, report_name, report_id)
- delete("/api/v1/accounts/#{account}/reports/#{report_name}/#{report_id}")
+ prefix "/api/v1/accounts/:account/reports/" do
+ get :report_list
+ post :start_report, ":report_name"
+ get :report_history, ":report_name"
+ get :report_status, ":report_name/:report_id"
+ delete :delete_report, ":report_name/:report_id"
end
def download_report(url, save_location=nil)
#This method takes the verified URL returned in a Canvas report (attachment['url']), and if
#a save_location is included, it will download it in chunks to the disk to save memory. You