Class: DpdApi::Client::Response
- Inherits:
-
Object
- Object
- DpdApi::Client::Response
- Defined in:
- lib/dpd_api/client/response.rb
Defined Under Namespace
Classes: ResourceBuilder
Instance Method Summary collapse
-
#initialize(url) ⇒ Response
constructor
A new instance of Response.
- #response(method, params = {}, options = {}) ⇒ Object
Constructor Details
#initialize(url) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/dpd_api/client/response.rb', line 6 def initialize(url) @url = url @client = Savon.client(wsdl: @url) end |
Instance Method Details
#response(method, params = {}, options = {}) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/dpd_api/client/response.rb', line 11 def response(method, params = {}, = {}) builder = ResourceBuilder.new(@client, method, params, ) builder.resources rescue Savon::SOAPFault => error { errors: error.to_s } end |