Class: Sunspot::Facet

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot/facet.rb

Direct Known Subclasses

InstantiatedFacet

Instance Method Summary collapse

Constructor Details

#initialize(facet_data) ⇒ Facet

:nodoc:



3
4
5
# File 'lib/sunspot/facet.rb', line 3

def initialize(facet_data) #:nodoc:
  @facet_data = facet_data
end

Instance Method Details

#nameObject Also known as: field_name

For field facets, this is the field name. For query facets, this is the name given to the #facet method in the DSL.



11
12
13
# File 'lib/sunspot/facet.rb', line 11

def name
  @facet_data.name
end

#rowsObject

Collection of FacetRow objects containing the individual values returned by the facet.



20
21
22
# File 'lib/sunspot/facet.rb', line 20

def rows
  @facet_data.rows { |value, count| FacetRow.new(value, count) }
end