Class: Sunspot::FieldFactory::Abstract
- Inherits:
-
Object
- Object
- Sunspot::FieldFactory::Abstract
- Defined in:
- lib/sunspot/field_factory.rb
Overview
Base class for field factories.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options = {}, &block) ⇒ Abstract
constructor
A new instance of Abstract.
Constructor Details
#initialize(name, options = {}, &block) ⇒ Abstract
Returns a new instance of Abstract.
16 17 18 19 20 21 22 23 24 |
# File 'lib/sunspot/field_factory.rb', line 16 def initialize(name, = {}, &block) @name = name.to_sym @data_extractor = if block DataExtractor::BlockExtractor.new(&block) else DataExtractor::AttributeExtractor.new(.delete(:using) || name) end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/sunspot/field_factory.rb', line 14 def name @name end |