Class: TogglBillable::Reports::Summary

Inherits:
Base
  • Object
show all
Defined in:
lib/toggl_billable/reports/summary.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #params, #report

Instance Method Summary collapse

Methods inherited from Base

#billable_items, #initialize, #last_month_billable

Constructor Details

This class inherits a constructor from TogglBillable::Reports::Base

Instance Method Details

#get_report(options) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/toggl_billable/reports/summary.rb', line 4

def get_report(options)
  params[:since]       = options[:start_date]
  params[:until]       = options[:end_date]
  params[:grouping]    = options[:grouping] if options[:grouping]
  params[:subgrouping] = options[:subgrouping] if options[:grouping]

  request = "summary?#{hash_to_params}"
  @report = JSON.parse(Client.report_get(request).body)
end