Class: Quickbooks::Service::ChangeDataCapture

Inherits:
BaseService
  • Object
show all
Defined in:
lib/quickbooks/service/change_data_capture.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

#after_request, #around_request, #base_uri, #before_request, #company_id, #last_response_intuit_tid, #last_response_xml, #oauth

Instance Method Summary collapse

Methods inherited from BaseService

#access_token=, #default_model_query, #initialize, #is_json?, #is_pdf?, #realm_id=, #rebuild_connection!, #url_for_base, #url_for_resource

Methods included from ServiceCrud

#all, #create, #delete, #delete_by_query_string, #exists?, #fetch_by_id, #find_by, #query, #query_in_batches

Methods included from Util::Logging

#log, #log?, #log_xml

Constructor Details

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

Instance Method Details

#since(entity_list, timestamp) ⇒ Object



11
12
13
14
# File 'lib/quickbooks/service/change_data_capture.rb', line 11

def since(entity_list, timestamp)
  do_http_get(url_for_query(entity_list, "changedSince=#{URI.encode_www_form_component(timestamp.iso8601)}"))
  model.new(:xml => @last_response_xml)
end

#url_for_query(entity_list, query = nil) ⇒ Object



5
6
7
8
9
# File 'lib/quickbooks/service/change_data_capture.rb', line 5

def url_for_query(entity_list, query=nil)
  q = entity_list.join(",")
  q = "#{q}&#{query}" if query.present?
  return "#{url_for_base}/cdc?entities=#{q}"
end