Class: ShelfWatch::Resources::Reports
- Inherits:
-
Object
- Object
- ShelfWatch::Resources::Reports
- Defined in:
- lib/shelfwatch/resources/reports.rb
Overview
Report list and generate endpoints.
Instance Method Summary collapse
-
#generate(report_id, start_date:, end_date:, project_id: nil) ⇒ Object
Generate a report by report_id (see #list).
-
#initialize(client) ⇒ Reports
constructor
A new instance of Reports.
-
#list(project_id: nil) ⇒ Object
List available reports for the project.
Constructor Details
#initialize(client) ⇒ Reports
Returns a new instance of Reports.
7 8 9 |
# File 'lib/shelfwatch/resources/reports.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#generate(report_id, start_date:, end_date:, project_id: nil) ⇒ Object
Generate a report by report_id (see #list).
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/shelfwatch/resources/reports.rb', line 21 def generate(report_id, start_date:, end_date:, project_id: nil) @client.request( "GET", "/v2/reports/generate", params: Http.drop_none( project_id: @client.project(project_id), report_id: report_id, start_date: Http.format_day(start_date), end_date: Http.format_day(end_date) ) ) end |