Sha256: 83a74876491013a9ef73f40b154ff74702ff8756c9a21219b6ad7f77a2fc1307

Contents?: true

Size: 1.2 KB

Versions: 25

Compression:

Stored size: 1.2 KB

Contents

module Exlibris
  module Primo
    module WebService
      module Response
        module SearchStats
          def total_time
            @total_time ||= search_set["TOTAL_TIME"] if search_set
          end
          alias :time :total_time

          def hit_time
            @hit_time ||= search_set["HIT_TIME"] if search_set
          end
          alias :search_time :hit_time

          def total_hits
            @total_hits ||= Integer(search_set["TOTALHITS"]) if search_set
          end
          alias :hits :total_hits
          alias :count :total_hits
          alias :size :total_hits

          def first_hit
            @first_hit ||= search_set["FIRSTHIT"] if search_set
          end

          def last_hit
            @last_hit ||= search_set["LASTHIT"] if search_set
          end

          def local?
            @local ||= parse_local(search_set["IS_LOCAL"]) if search_set
          end

          def parse_local local
            (local.eql? "true") if local
          end
          protected :parse_local

          def search_set
            @search_set ||= xml.at_xpath("//search:DOCSET", response_namespaces)
          end
          protected :search_set
        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/response/search_stats.rb
exlibris-primo-2.1.0 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-2.0.0 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.9 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.8 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.7 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.6 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.5 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.4 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.3 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.2 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.1 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.1.0 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.0.11 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.0.10 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.0.9 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.0.8 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.0.7 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.0.6 lib/exlibris/primo/web_service/response/search_stats.rb
exlibris-primo-1.0.5 lib/exlibris/primo/web_service/response/search_stats.rb