Sha256: d6998e40f086b736d88530455bb80881be277c7c73e936c19657fbd63f58ed04

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

require "ox"
require "transformator/transformation/step"
require_relative "../request_transformation"

class Skala::PrimoAdapter::Search::RequestTransformation::
  SetLocations < Transformator::Transformation::Step

  def call
    transformation.locations.each do |_location|
      transformation.inner_search_request.locate("PrimoSearchRequest/Locations").first.tap do |_node|
        _node << Ox.parse(
          <<-xml
            <uic:Location type="#{_location[:type]}" value="#{_location[:value]}"/>
          xml
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skala-1.1.0 lib/skala/primo_adapter/search/request_transformation/set_locations.rb