Class: Quickbooks::Service::PurchaseOrder
- Inherits:
-
BaseService
- Object
- BaseService
- Quickbooks::Service::PurchaseOrder
- Defined in:
- lib/quickbooks/service/purchase_order.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
Attributes included from Util::Logging
Instance Method Summary collapse
- #delete(purchase_order) ⇒ Object
- #fetch_by_id(id, params = {}) ⇒ Object
- #pdf(purchase_order) ⇒ Object
- #url_for_query(query = nil, start_position = 1, max_results = 20, options = {}) ⇒ Object
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_by_query_string, #exists?, #find_by, #query, #query_in_batches
Methods included from Util::Logging
#condense_logs?, #log?, #log_multiple, #log_xml
Constructor Details
This class inherits a constructor from Quickbooks::Service::BaseService
Instance Method Details
#delete(purchase_order) ⇒ Object
5 6 7 |
# File 'lib/quickbooks/service/purchase_order.rb', line 5 def delete(purchase_order) delete_by_query_string(purchase_order) end |
#fetch_by_id(id, params = {}) ⇒ Object
9 10 11 12 |
# File 'lib/quickbooks/service/purchase_order.rb', line 9 def fetch_by_id(id, params = {}) url = "#{url_for_base}/purchaseorder/#{id}?minorversion=#{Quickbooks.minorversion}" fetch_object(model, url, params) end |
#pdf(purchase_order) ⇒ Object
19 20 21 22 23 |
# File 'lib/quickbooks/service/purchase_order.rb', line 19 def pdf(purchase_order) url = "#{url_for_resource(model::REST_RESOURCE)}/#{purchase_order.id}/pdf" response = do_http_raw_get(url, {}, {'Accept' => 'application/pdf'}) response.plain_body end |
#url_for_query(query = nil, start_position = 1, max_results = 20, options = {}) ⇒ Object
14 15 16 17 |
# File 'lib/quickbooks/service/purchase_order.rb', line 14 def url_for_query(query = nil, start_position = 1, max_results = 20, = {}) url = super(query, start_position, max_results, ) "#{url}&minorversion=#{Quickbooks.minorversion}" end |