Sha256: f66422cbde6c4b08650384d3bf46f1b54c2aa129c070b1b0309954d28371a05d

Contents?: true

Size: 441 Bytes

Versions: 5

Compression:

Stored size: 441 Bytes

Contents

require "celsius/transformation/step"
require "ox"

class Celsius::Primo::SoapApi::Searcher::SearchBrief::SearchRequestTransformation::
  SetLanguages < Celsius::Transformation::Step

  def call
    (transformation.languages || []).each do |language|
      transformation.inner_search_request.locate("PrimoSearchRequest/Languages").first.tap do |node|
        node << Ox.parse("<Language>#{language}</Language>")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
celsius-primo-0.1.4 lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/set_languages.rb
celsius-primo-0.1.3 lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/set_languages.rb
celsius-primo-0.1.2 lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/set_languages.rb
celsius-primo-0.1.1 lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/set_languages.rb
celsius-primo-0.1.0 lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/set_languages.rb