Class: Sunspot::InstantiatedFacetRow
- Defined in:
- lib/sunspot/instantiated_facet_row.rb
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
A new instance of InstantiatedFacetRow.
Constructor Details
#initialize(value, count, facet) ⇒ InstantiatedFacetRow
Returns a new instance of InstantiatedFacetRow.
5 6 7 8 |
# File 'lib/sunspot/instantiated_facet_row.rb', line 5 def initialize(value, count, facet) 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.
15 16 17 18 19 20 |
# File 'lib/sunspot/instantiated_facet_row.rb', line 15 def instance unless defined?(@instance) @facet.populate_instances! end @instance end |