Class: Quickbooks::Service::PaymentMethod

Inherits:
BaseService
  • Object
show all
Includes:
ServiceCrud
Defined in:
lib/quickbooks/service/payment_method.rb

Constant Summary

Constants inherited from BaseService

BaseService::HTTP_ACCEPT, BaseService::HTTP_ACCEPT_ENCODING, BaseService::HTTP_CONTENT_TYPE, 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 included from ServiceCrud

#create, #delete, #delete_by_query_string, #fetch_by_id, #query, #update

Methods inherited from BaseService

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

Methods included from Util::Logging

#log

Constructor Details

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

Instance Method Details

#default_model_query ⇒ Object



6
7
8
# File 'lib/quickbooks/service/payment_method.rb', line 6

def default_model_query
  "SELECT * FROM PaymentMethod"
end

#fetch_by_name(name) ⇒ Object



10
11
12
# File 'lib/quickbooks/service/payment_method.rb', line 10

def fetch_by_name(name)
  self.query(search_name_query(name)).entries.first
end

#model ⇒ Object



14
15
16
# File 'lib/quickbooks/service/payment_method.rb', line 14

def model
  Quickbooks::Model::PaymentMethod
end

#search_name_query(name) ⇒ Object



18
19
20
# File 'lib/quickbooks/service/payment_method.rb', line 18

def search_name_query(name)
  "SELECT * FROM PaymentMethod WHERE Name = '#{name}'"
end