Class: Skala::PrimoAdapter::SoapApi::SearchBrief
- Inherits:
-
Object
- Object
- Skala::PrimoAdapter::SoapApi::SearchBrief
- Defined in:
- lib/skala/primo_adapter/soap_api/search_brief.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
Instance Method Summary collapse
- #call(request) ⇒ Object
-
#initialize(adapter) ⇒ SearchBrief
constructor
A new instance of SearchBrief.
Constructor Details
#initialize(adapter) ⇒ SearchBrief
Returns a new instance of SearchBrief.
8 9 10 |
# File 'lib/skala/primo_adapter/soap_api/search_brief.rb', line 8 def initialize(adapter) self.adapter = adapter end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
6 7 8 |
# File 'lib/skala/primo_adapter/soap_api/search_brief.rb', line 6 def adapter @adapter end |
Instance Method Details
#call(request) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/skala/primo_adapter/soap_api/search_brief.rb', line 12 def call(request) begin Timeout::timeout(adapter.timeout) do Faraday.post(adapter.soap_api_url, request, { "Content-Type" => "application/xml", # necessary since new soap endpoint (else -> premature end of file error) "SOAPAction" => "searchBrief" }) .body end rescue Timeout::Error raise Timeout::Error, "Primo search request aborted! The server has not responded within #{adapter.timeout} seconds!" end end |