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

Returns a new instance of Facet.



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

def initialize(facet_data)
  @facet_data = facet_data
end

Instance Method Details

#nameObject Also known as: field_name



7
8
9
# File 'lib/sunspot/facet.rb', line 7

def name
  @facet_data.name
end

#rowsObject



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

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