Sha256: ea08c1f0b30c61faabe2c66e90336b8d62ace03428056db916da8bc9d0112b2a

Contents?: true

Size: 906 Bytes

Versions: 1

Compression:

Stored size: 906 Bytes

Contents

require "transformator/transformation"
require_relative "../search"

class Skala::PrimoAdapter::Search::RequestTransformation < Transformator::Transformation
  extend Forwardable

  require_directory "#{File.dirname(__FILE__)}/request_transformation"

  attr_accessor :adapter
  attr_accessor :inner_search_request
  attr_accessor :on_campus

  delegate [:languages, :locations, :institution] => :adapter

  def call(source, adapter, options = {})
    self.adapter = adapter
    self.on_campus = options.try(:[], :on_campus)
    super(source, options)
  end

  sequence [
    SetupTarget,
    SetupInnerSearchRequest,
    [
      [
        AddQueries,
        SetStartIndex,
        SetBulkSize,
        SetLanguages,
        AddSortByList,
        SetLocations,
        SetOnCampus
      ],
      SetInstitution
    ],
    ToggleBoolOperator,
    EmbedInnerSearchRequest,
    SerializeTargetAsXml
  ]
end

Version data entries

1 entries across 1 versions & 1 rubygems

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