class Celsius::Primo::SoapApi::Searcher::SearchBrief::SearchRequestTransformation::SetLocations

Public Instance Methods

call() click to toggle source
# File lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/set_locations.rb, line 7
def call
  (transformation.locations || []).each do |location|
    type = location[:type] || location["type"]
    value = location[:value] || location["value"]

    transformation.inner_search_request.locate("PrimoSearchRequest/Locations").first.tap do |node|
      node << Ox.parse("<uic:Location type=\"#{type}\" value=\"#{value}\"/>")
    end
  end
end