Class: Sunspot::DataExtractor::Constant

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Constant

Returns a new instance of Constant.



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

def initialize(value)
  @value = value
end

Instance Method Details

#value_for(object) ⇒ Object



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

def value_for(object)
  @value
end