Sha256: 97ba3e81a2790f54550f6cfd5842bd006619abf736c069ca9bad067cc0e413e5

Contents?: true

Size: 1.04 KB

Versions: 37

Compression:

Stored size: 1.04 KB

Contents

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

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

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

    #
    # Total number of Objs available that have this value.
    #
    # @api public
    #
    # 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

    #
    # The Objs that were included in this search.
    #
    # @api public
    #
    # 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

37 entries across 37 versions & 1 rubygems

Version Path
scrivito_sdk-1.5.5 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.5.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.4.3 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.4 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.4.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.3 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.3.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.6.0.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.2 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.2.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.1.rc2 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.1.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.0 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.0.rc2 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.5.0.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.4.2 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.4.1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.4.1.rc1 lib/scrivito/obj_facet_value.rb
scrivito_sdk-1.4.0 lib/scrivito/obj_facet_value.rb