Class: Quickeebooks::Windows::Service::ServiceBase
- Inherits:
-
Object
- Object
- Quickeebooks::Windows::Service::ServiceBase
- Defined in:
- lib/quickeebooks/windows/service/service_base.rb
Direct Known Subclasses
AccessToken, Account, Clazz, CompanyMetaData, Customer, CustomerMsg, Invoice, Item, Payment, SalesReceipt, SalesRep, SalesTax, ShipMethod
Constant Summary collapse
- XML_NS =
%{xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns3="http://www.intuit.com/sb/cdm"}
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
readonly
Returns the value of attribute base_uri.
-
#last_response_body ⇒ Object
readonly
Returns the value of attribute last_response_body.
-
#last_response_xml ⇒ Object
readonly
Returns the value of attribute last_response_xml.
-
#oauth ⇒ Object
Returns the value of attribute oauth.
-
#realm_id ⇒ Object
Returns the value of attribute realm_id.
Instance Method Summary collapse
- #access_token=(token) ⇒ Object
- #guid ⇒ Object
-
#initialize(oauth_access_token = nil, realm_id = nil) ⇒ ServiceBase
constructor
A new instance of ServiceBase.
- #url_for_base(raw) ⇒ Object
- #url_for_resource(resource) ⇒ Object
Constructor Details
#initialize(oauth_access_token = nil, realm_id = nil) ⇒ ServiceBase
Returns a new instance of ServiceBase.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 27 def initialize(oauth_access_token = nil, realm_id = nil) @base_uri = 'https://services.intuit.com/sb' if !oauth_access_token.nil? && !realm_id.nil? msg = "Quickeebooks::Windows::ServiceBase - " msg += "This version of the constructor is deprecated. " msg += "Use the no-arg constructor and set the AccessToken and the RealmID using the accessors." warn(msg) access_token = oauth_access_token realm_id = realm_id end end |
Instance Attribute Details
#base_uri ⇒ Object (readonly)
Returns the value of attribute base_uri.
21 22 23 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 21 def base_uri @base_uri end |
#last_response_body ⇒ Object (readonly)
Returns the value of attribute last_response_body.
22 23 24 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 22 def last_response_body @last_response_body end |
#last_response_xml ⇒ Object (readonly)
Returns the value of attribute last_response_xml.
23 24 25 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 23 def last_response_xml @last_response_xml end |
#oauth ⇒ Object
Returns the value of attribute oauth.
20 21 22 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 20 def oauth @oauth end |
#realm_id ⇒ Object
Returns the value of attribute realm_id.
19 20 21 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 19 def realm_id @realm_id end |
Instance Method Details
#access_token=(token) ⇒ Object
40 41 42 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 40 def access_token=(token) @oauth = token end |
#guid ⇒ Object
56 57 58 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 56 def guid UUIDTools::UUID.random_create.to_s.gsub('-', '') end |
#url_for_base(raw) ⇒ Object
52 53 54 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 52 def url_for_base(raw) "#{@base_uri}/#{raw}/v2/#{@realm_id}" end |
#url_for_resource(resource) ⇒ Object
48 49 50 |
# File 'lib/quickeebooks/windows/service/service_base.rb', line 48 def url_for_resource(resource) url_for_base(resource) end |