Class: Quickbooks::Service::Reports
- Inherits:
-
BaseService
- Object
- BaseService
- Quickbooks::Service::Reports
- 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
- #query(object_query = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date', options = {}) ⇒ Object
- #url_for_query(which_report = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date', options = {}) ⇒ Object
Methods inherited from BaseService
#access_token=, #default_model_query, #initialize, #is_json?, #is_pdf?, #realm_id=, #url_for_base, #url_for_resource
Methods included from ServiceCrud
#all, #create, #delete, #delete_by_query_string, #fetch_by_id, #find_by, #query_in_batches
Methods included from Util::Logging
Constructor Details
This class inherits a constructor from Quickbooks::Service::BaseService
Instance Method Details
#query(object_query = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date', options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/quickbooks/service/reports.rb', line 20 def query(object_query = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date', = {}) do_http_get(url_for_query(object_query, date_macro, )) model.new(:xml => @last_response_xml) end |
#url_for_query(which_report = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date', options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/quickbooks/service/reports.rb', line 6 def url_for_query(which_report = 'BalanceSheet', date_macro = 'This Fiscal Year-to-date', = {}) if( == {}) return "#{url_for_base}/reports/#{which_report}?date_macro=#{URI.encode_www_form_component(date_macro)}" else = "" .each do |key, value| += "#{key}=#{value}&" end = [0..-2] .gsub!(/\s/,"%20") return "#{url_for_base}/reports/#{which_report}?#{}" end end |