Sha256: 67ea5e48d452df3002932e64659883ae5abb5d7c7bf645227a6ffd8705475a38
Contents?: true
Size: 1.06 KB
Versions: 18
Compression:
Stored size: 1.06 KB
Contents
module Gummi module DbLayer module Document module Search class Result attr_reader :took, :total, :hits, :facets def initialize(response, converter, per_page, page) @success = !!response @response = Hashie::Mash.new response @took = @response.took @total = @response.hits.total if @response.hits @hits = @response.hits.hits if @response.hits @facets = @response.facets || Hashie::Mash.new @converter = converter @per_page = per_page @page = page end def documents @documents ||= begin documents = Array(converter.hits_to_documents(hits)) if hits Leaflet::Collection.new documents, total: total, page: page, per_page: per_page end end def success? @success end private attr_reader :response, :converter, :per_page, :page, :hits end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems