Class: Sunspot::DataExtractor::Constant

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

Overview

Constant data extractors simply return the same value for every object.

Instance Method Summary (collapse)

Constructor Details

- (Constant) initialize(value)

A new instance of Constant



41
42
43
# File 'sunspot/lib/sunspot/data_extractor.rb', line 41

def initialize(value)
  @value = value
end

Instance Method Details

- (Object) value_for(object)



45
46
47
# File 'sunspot/lib/sunspot/data_extractor.rb', line 45

def value_for(object)
  @value
end