Sha256: 98ab2bf8e8531eea1820712b8950f48ede0ed2accd84b1617b2b335af0fb264e

Contents?: true

Size: 543 Bytes

Versions: 9

Compression:

Stored size: 543 Bytes

Contents

module Sunspot
  class Facet
    def initialize(facet_data) #:nodoc:
      @facet_data = facet_data
    end

    # 
    # For field facets, this is the field name. For query facets, this is the
    # name given to the #facet method in the DSL.
    #
    def name
      @facet_data.name
    end
    alias_method :field_name, :name

    # 
    # Collection of FacetRow objects containing the individual values returned
    # by the facet.
    #
    def rows
      @facet_data.rows { |value, count| FacetRow.new(value, count) }
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
benjaminkrause-sunspot-0.9.7 lib/sunspot/facet.rb
benjaminkrause-sunspot-0.9.8 lib/sunspot/facet.rb
sunspot-0.10.5 lib/sunspot/facet.rb
sunspot-0.10.4 lib/sunspot/facet.rb
kuahyeow-sunspot-0.10.3 lib/sunspot/facet.rb
sunspot-0.10.3 lib/sunspot/facet.rb
sunspot-0.10.2 lib/sunspot/facet.rb
sunspot-0.10.1 lib/sunspot/facet.rb
sunspot-0.10.0 lib/sunspot/facet.rb