Class: Sunspot::Search::FacetRow

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (FacetRow) initialize(value, count, facet)

:nodoc:



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

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

Instance Attribute Details

- (Object) count (readonly)

Returns the value of attribute count



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

def count
  @count
end

- (Object) instance

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 'sunspot/lib/sunspot/search/facet_row.rb', line 15

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

- (Object) value (readonly)

Returns the value of attribute value



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

def value
  @value
end

Instance Method Details

- (Object) inspect



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

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