Sha256: 6706a99a85af234dcdb6fd812aaae0c60d70f4e32492feda124e3bae0986512e

Contents?: true

Size: 724 Bytes

Versions: 25

Compression:

Stored size: 724 Bytes

Contents

module Exlibris
  module Primo
    module WebService
      module Request
        module SortBys
          # 
          # Returns a lambda that takes a Nokogiri::XML::Builder as an argument
          # and appends sort bys XML to it.
          # 
          def sort_bys_xml
            lambda { |xml|
              xml.SortByList {
                sort_bys.each do |sort_by|
                  xml.SortField sort_by
                end
              } unless sort_bys.empty?
            }
          end
          protected :sort_bys_xml

          def sort_bys
            @sort_bys ||= []
          end

          def add_sort_by(sort_by)
            sort_bys << sort_by
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
exlibris-primo-2.1.1 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-2.1.0 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-2.0.0 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.9 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.8 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.7 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.6 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.5 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.4 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.3 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.2 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.1 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.1.0 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.0.11 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.0.10 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.0.9 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.0.8 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.0.7 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.0.6 lib/exlibris/primo/web_service/request/search/sort_bys.rb
exlibris-primo-1.0.5 lib/exlibris/primo/web_service/request/search/sort_bys.rb