Sha256: 212af3ac87eb806a71e7100b4be2c3a11ae658cdf7a887ac130edf59f5763daf

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

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

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

  def call
    if source.queries.present? && source.queries.all? { |_query| _query.type.to_sym == :ids }
      bool_opeator_node = transformation.inner_search_request.locate("PrimoSearchRequest/QueryTerms/BoolOpeator").first
      bool_opeator_node.nodes.clear << "OR"
    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/toggle_bool_operator.rb