Class: Quickbooks::Service::Reports

Inherits:
BaseService show all
Defined in:
lib/quickbooks/service/reports.rb

Constant Summary

Constants inherited from BaseService

BaseService::BASE_DOMAIN, BaseService::HTTP_ACCEPT, BaseService::HTTP_ACCEPT_ENCODING, BaseService::HTTP_CONTENT_TYPE, BaseService::SANDBOX_DOMAIN, BaseService::XML_NS

Instance Attribute Summary

Attributes inherited from BaseService

#base_uri, #company_id, #last_response_body, #last_response_xml, #oauth

Instance Method Summary collapse

Methods inherited from BaseService

#access_token=, #default_model_query, #initialize, #realm_id=, #url_for_base, #url_for_resource

Methods included from ServiceCrud

#create, #delete, #delete_by_query_string, #fetch_by_id, #query_in_batches

Methods included from Util::Logging

#log, #log_xml

Constructor Details

This class inherits a constructor from Quickbooks::Service::BaseService

Instance Method Details

#fetch_collection(model, date_macro, object_query) ⇒ Object



9
10
11
12
13
14
# File 'lib/quickbooks/service/reports.rb', line 9

def fetch_collection(model, date_macro, object_query)
  response = do_http_get(url_for_query(object_query, date_macro))

  parse_collection(response, model)

end

#query(object_query = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date') ⇒ Object



16
17
18
# File 'lib/quickbooks/service/reports.rb', line 16

def query(object_query = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date')
  fetch_collection(model, date_macro , object_query)
end

#url_for_query(which_report = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date') ⇒ Object



5
6
7
# File 'lib/quickbooks/service/reports.rb', line 5

def url_for_query(which_report = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date')
  "#{url_for_base}/reports/#{which_report}?date_macro=#{URI.encode_www_form_component(date_macro)}"
end