Class: QboApi
- Inherits:
-
Object
- Object
- QboApi
- Extended by:
- Configuration
- Includes:
- ApiMethods, Attachment, Connection, Entity, Supporting, Util
- Defined in:
- lib/qbo_api/error.rb,
lib/qbo_api.rb,
lib/qbo_api/util.rb,
lib/qbo_api/entity.rb,
lib/qbo_api/version.rb,
lib/qbo_api/attachment.rb,
lib/qbo_api/connection.rb,
lib/qbo_api/supporting.rb,
lib/qbo_api/api_methods.rb,
lib/qbo_api/configuration.rb,
lib/qbo_api/raise_http_exception.rb
Defined Under Namespace
Modules: ApiMethods, Attachment, Configuration, Connection, Entity, Supporting, Util Classes: BadGateway, BadRequest, Error, Forbidden, GatewayTimeout, InternalServerError, NotFound, NotImplementedError, RaiseHttpException, ServiceUnavailable, TooManyRequests, Unauthorized
Constant Summary collapse
- V3_ENDPOINT_BASE_URL =
'https://sandbox-quickbooks.api.intuit.com/v3/company/'
- PAYMENTS_API_BASE_URL =
'https://sandbox.api.intuit.com/quickbooks/v4/payments'
- LOG_TAG =
"[QuickBooks]"
- VERSION =
"3.0.2"
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#realm_id ⇒ Object
Returns the value of attribute realm_id.
Attributes included from Util
Instance Method Summary collapse
- #connection(url: endpoint_url) ⇒ Object
- #default_attributes ⇒ Object
- #endpoint_url ⇒ Object
-
#initialize(attributes = {}) ⇒ QboApi
constructor
A new instance of QboApi.
Methods included from Configuration
log, log=, logger, logger=, minor_version, minor_version=, production, production=, request_id, request_id=
Methods included from ApiMethods
#all, #create, #deactivate, #delete, #get, #get_by_query_filter, #query, #update, #void
Methods included from Attachment
#attachment_connection, #delete_attachment, #read_attachment, #upload_attachment
Methods included from Util
#add_minor_version_to, #add_params_to_path, #add_request_id_to, #cdc_time, #esc, #finalize_path, #uuid
Methods included from Entity
#entity_path, #extract_entity_from_query, #is_name_list_entity?, #is_transaction_entity?, #is_voidable_transaction_entity?, #name_list_entities, #singular, #snake_to_camel, #supporting_entities, #transaction_entities, #voidable_transaction_entities
Methods included from Supporting
#batch, #cdc, #deliver, #reports
Methods included from Connection
#authorized_json_connection, #authorized_multipart_connection, #build_connection, #raw_request, #request, #response
Constructor Details
#initialize(attributes = {}) ⇒ QboApi
Returns a new instance of QboApi.
32 33 34 35 36 37 38 39 40 |
# File 'lib/qbo_api.rb', line 32 def initialize(attributes = {}) raise ArgumentError, "missing keyword: access_token" unless attributes.key?(:access_token) raise ArgumentError, "missing keyword: realm_id" unless attributes.key?(:realm_id) attributes = default_attributes.merge!(attributes) attributes.each do |attribute, value| public_send("#{attribute}=", value) end @endpoint_url = get_endpoint end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
25 26 27 |
# File 'lib/qbo_api.rb', line 25 def access_token @access_token end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
26 27 28 |
# File 'lib/qbo_api.rb', line 26 def endpoint @endpoint end |
#realm_id ⇒ Object
Returns the value of attribute realm_id.
25 26 27 |
# File 'lib/qbo_api.rb', line 25 def realm_id @realm_id end |
Instance Method Details
#connection(url: endpoint_url) ⇒ Object
48 49 50 |
# File 'lib/qbo_api.rb', line 48 def connection(url: endpoint_url) @connection ||= (url) end |
#default_attributes ⇒ Object
42 43 44 45 46 |
# File 'lib/qbo_api.rb', line 42 def default_attributes { endpoint: :accounting } end |
#endpoint_url ⇒ Object
52 53 54 |
# File 'lib/qbo_api.rb', line 52 def endpoint_url @endpoint_url.dup end |