Class: TaxCloud::Client
- Inherits:
-
Savon::Client
- Object
- Savon::Client
- TaxCloud::Client
- Defined in:
- lib/tax_cloud/client.rb
Overview
A Client
communicates with the TaxCloud service.
Instance Method Summary collapse
-
#call(method, message = {}) ⇒ Object
Make a safe SOAP call.
-
#initialize ⇒ Client
constructor
Create a new client.
-
#ping ⇒ Object
Ping the TaxCloud service.
- #request(method, message = {}) ⇒ Object
Constructor Details
#initialize ⇒ Client
Create a new client.
7 8 9 |
# File 'lib/tax_cloud/client.rb', line 7 def initialize super client_params end |
Instance Method Details
#call(method, message = {}) ⇒ Object
Make a safe SOAP call. Will raise a TaxCloud::Errors::SoapError on error.
Parameters
- method
-
SOAP method.
- body
-
Body content.
17 18 19 20 21 |
# File 'lib/tax_cloud/client.rb', line 17 def call(method, = {}) safe do super method, message: .merge(auth_params) end end |
#ping ⇒ Object
Ping the TaxCloud service.
Returns “OK” or raises an error if the TaxCloud service is unreachable.
30 31 32 |
# File 'lib/tax_cloud/client.rb', line 30 def ping TaxCloud::Responses::Ping.parse request(:ping) end |
#request(method, message = {}) ⇒ Object
23 24 25 |
# File 'lib/tax_cloud/client.rb', line 23 def request(method, = {}) call method, end |