Class: Skala::PrimoAdapter::Search::ResultTransformation::ParseSearchBriefResponse

Inherits:
Transformator::Transformation::Step
  • Object
show all
Defined in:
lib/skala/primo_adapter/search/result_transformation/parse_search_brief_response.rb

Instance Method Summary collapse

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/skala/primo_adapter/search/result_transformation/parse_search_brief_response.rb', line 8

def call
  transformation.search_brief_response =
  Nokogiri::XML(source)
  .remove_namespaces!
  .at_xpath("/Envelope/Body/searchBriefResponse/searchBriefReturn")
  .try(:text)
  .try do |_embedded_search_brief_response|
    Nokogiri::XML(_embedded_search_brief_response) { |config| config.noblanks }
    .remove_namespaces!
    .at_xpath("//SEGMENTS/JAGROOT/RESULT")
  end
end