Class: OpenSRF::HTTPTranslatorRequest
- Inherits:
-
Object
- Object
- OpenSRF::HTTPTranslatorRequest
- Defined in:
- lib/opensrf/http_translator_request.rb
Overview
A stateful endpoint, described in this documentation: docs.evergreen-ils.org/eg/docs/latest/integrations/web_services.html#_http_translator
Instance Method Summary collapse
-
#initialize(configuration:, service:, payload:) ⇒ HTTPTranslatorRequest
constructor
A new instance of HTTPTranslatorRequest.
- #response ⇒ Object
Constructor Details
#initialize(configuration:, service:, payload:) ⇒ HTTPTranslatorRequest
Returns a new instance of HTTPTranslatorRequest.
12 13 14 15 16 |
# File 'lib/opensrf/http_translator_request.rb', line 12 def initialize(configuration:, service:, payload:) @configuration = configuration @service = service @payload = payload end |
Instance Method Details
#response ⇒ Object
18 19 20 21 22 23 |
# File 'lib/opensrf/http_translator_request.rb', line 18 def response raw = Net::HTTP.start(uri.hostname, uri.port, ) do |http| http.request(request) end OpenSRF::ClassAndData.parse(::JSON.parse(raw.body).first, ['payload']).data end |