Class: Sunspot::FieldFactory::Abstract

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

Overview

Base class for field factories.

Direct Known Subclasses

Dynamic, Static

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Abstract) initialize(name, options = {}, &block)

A new instance of Abstract



16
17
18
19
20
21
22
23
24
# File 'sunspot/lib/sunspot/field_factory.rb', line 16

def initialize(name, options = {}, &block)
  @name = name.to_sym
  @data_extractor =
    if block
      DataExtractor::BlockExtractor.new(&block)
    else
      DataExtractor::AttributeExtractor.new(options.delete(:using) || name)
    end
end

Instance Attribute Details

- (Object) name (readonly)

Returns the value of attribute name



14
15
16
# File 'sunspot/lib/sunspot/field_factory.rb', line 14

def name
  @name
end