Class: Sunspot::DataExtractor::AttributeExtractor
- Inherits:
-
AbstractExtractor
- Object
- AbstractExtractor
- Sunspot::DataExtractor::AttributeExtractor
- Defined in:
- lib/sunspot/data_extractor.rb
Overview
AttributeExtractors extract data by simply calling a method on the block.
Constant Summary
Constants inherited from AbstractExtractor
Sunspot::DataExtractor::AbstractExtractor::BLACKLIST_REGEXP
Instance Method Summary collapse
-
#initialize(attribute_name) ⇒ AttributeExtractor
constructor
A new instance of AttributeExtractor.
- #value_for(object) ⇒ Object
Constructor Details
#initialize(attribute_name) ⇒ AttributeExtractor
Returns a new instance of AttributeExtractor.
42 43 44 |
# File 'lib/sunspot/data_extractor.rb', line 42 def initialize(attribute_name) @attribute_name = attribute_name end |
Instance Method Details
#value_for(object) ⇒ Object
46 47 48 |
# File 'lib/sunspot/data_extractor.rb', line 46 def value_for(object) super object.send(@attribute_name) end |