Sha256: ed1abc03e92ea285cc706c5f341669f548d2512fee38c09082baf912475921af

Contents?: true

Size: 892 Bytes

Versions: 25

Compression:

Stored size: 892 Bytes

Contents

module Exlibris
  module Primo
    module WebService
      module Request
        module Locations
          # 
          # Returns a lambda that takes a Nokogiri::XML::Builder as an argument
          # and appends locations XML to it.
          # 
          def locations_xml
            lambda { |xml|
              # Specify the uic namespace. Not great, but adequate.
              xml.Locations {
                locations.each do |location|
                  xml['uic'].Location(:type => location.kind, :value => location.value)
                end
              } unless locations.empty?
            }
          end
          protected :locations_xml

          def locations
            @locations ||= []
          end

          def add_location(kind, value)
            locations << Location.new(:kind => kind, :value => value)
          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/locations.rb
exlibris-primo-2.1.0 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-2.0.0 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.9 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.8 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.7 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.6 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.5 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.4 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.3 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.2 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.1 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.1.0 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.0.11 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.0.10 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.0.9 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.0.8 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.0.7 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.0.6 lib/exlibris/primo/web_service/request/search/locations.rb
exlibris-primo-1.0.5 lib/exlibris/primo/web_service/request/search/locations.rb