Sha256: 652439d699c30651b22fe6be0733528f2797b8408c190e5272484cc7a624f18b

Contents?: true

Size: 988 Bytes

Versions: 8

Compression:

Stored size: 988 Bytes

Contents

module Scrivito
  # Instances of this class represent the result of a faceted search.
  # @api beta
  class ObjFacetValue

    def initialize(value, total, included_objs = [])
      @name = value
      @count = total
      @included_objs = included_objs
    end

    # @api beta
    # The value of the attribute name of this ObjFacetValue.
    #
    # @return [String]
    def name
      @name
    end

    # @api beta
    # Total number of Objs available that have this value.
    #
    # Note that this refers to all Objs,
    # not just the Objs included in this search.
    # Also note that the count is approximate.
    # @return [Integer]
    def count
      @count
    end

    # @api beta
    # The Objs that were included in this search.
    #
    # if you did not specify +include_objs+ in your facet options,
    # an empty array is returned.
    # The Objs are ordered by relevance.
    # @return [Array<BasicObj>]
    def included_objs
      @included_objs
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scrivito_sdk-1.0.0 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.0.0.rc4 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.0.0.rc3 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.0.0.rc2 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.0.0.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-0.90.0 lib/scrivito/obj_facet_value.rb
scrivito_sdk-0.90.0.rc3 lib/scrivito/obj_facet_value.rb
scrivito_sdk-0.90.0.rc2 lib/scrivito/obj_facet_value.rb