Sha256: be764eb0550c744bd092d443cfa9aefe720bc9604a2fa2b32a6d2f02db8720ee

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

require_relative "../search"

class Skala::Adapter::Search::Result < Skala::Adapter::Operation::Result
  include Enumerable
  include Virtus.model

  # facets
  require_relative "./result/facet"
  require_relative "./result/histogram_facet"
  require_relative "./result/terms_facet"

  # other
  require_relative "./result/hit"

  attribute :facets,     Array[Facet], lazy: true
  attribute :hits,       Array[Hit],   lazy: true
  attribute :total_hits, Integer,      default: 0

  def each
    block_given? ? hits.each { |_element| yield _element } : hits.each
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skala-1.1.0 lib/skala/adapter/search/result.rb