Class: Sunspot::Search::StatRow

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stat_field, value, all_values, stat) ⇒ StatRow

:nodoc:



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

def initialize(stat_field, value, all_values, stat) #:nodoc:
  @stat_field, @value, @all_values, @stat = stat_field, value, all_values, stat
end

Instance Attribute Details

#all_valuesObject (readonly)

Returns the value of attribute all_values.



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

def all_values
  @all_values
end

#instanceObject

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



16
17
18
19
20
21
# File 'lib/search/stat_row.rb', line 16

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

#stat_fieldObject (readonly)

Returns the value of attribute stat_field.



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

def stat_field
  @stat_field
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#inspectObject



23
24
25
# File 'lib/search/stat_row.rb', line 23

def inspect
  "<Sunspot::Search::StatRow:#{stat_field.inspect} (#{value} - #{all_values})>"
end