Class: Sunspot::Search::FacetRow

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, count, facet, selected = nil) ⇒ FacetRow

:nodoc:



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

def initialize(value, count, facet, selected=nil) #:nodoc:
  @value, @count, @selected, @facet = value, count, facet, selected
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



4
5
6
# File 'lib/sunspot/search/facet_row.rb', line 4

def count
  @count
end

#instanceObject

Return the instance referenced by this facet row. Only valid for field facets whose fields are defined with the :references key.



15
16
17
18
19
20
# File 'lib/sunspot/search/facet_row.rb', line 15

def instance
  if !defined?(@instance)
    @facet.populate_instances
  end
  @instance
end

#selectedObject (readonly)

Returns the value of attribute selected.



4
5
6
# File 'lib/sunspot/search/facet_row.rb', line 4

def selected
  @selected
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/sunspot/search/facet_row.rb', line 4

def value
  @value
end

Instance Method Details

#inspectObject



22
23
24
# File 'lib/sunspot/search/facet_row.rb', line 22

def inspect
  "<Sunspot::Search::FacetRow:#{value.inspect} (#{count})>"
end