Class: Sunspot::InstantiatedFacetRow
- Defined in:
- lib/sunspot/instantiated_facet_row.rb
Overview
InstantiatedFacetRow objects represent a single value for an instantiated facet. As well as the usual FacetRow methods, InstantedFacetRow objects provide access to the persistent object referenced by the row’s value.
Instance Attribute Summary collapse
-
#instance ⇒ Object
Get the persistent object referenced by this row’s value.
Attributes inherited from FacetRow
Instance Method Summary collapse
-
#initialize(value, count, facet) ⇒ InstantiatedFacetRow
constructor
:nodoc:.
Constructor Details
#initialize(value, count, facet) ⇒ InstantiatedFacetRow
:nodoc:
10 11 12 13 |
# File 'lib/sunspot/instantiated_facet_row.rb', line 10 def initialize(value, count, facet) #:nodoc: super(value, count) @facet = facet end |
Instance Attribute Details
#instance ⇒ Object
Get the persistent object referenced by this row’s value. Instances are batch-lazy-loaded, which means that for a given facet, all of the instances are loaded the first time any row’s instance is requested.
20 21 22 23 24 25 |
# File 'lib/sunspot/instantiated_facet_row.rb', line 20 def instance unless defined?(@instance) @facet.populate_instances! end @instance end |