Class: Sunspot::Field::AttributeField

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

Overview

AttributeFields call methods directly on indexed objects and index the return value of the method. By default, the field name is also the attribute that provides the value for indexing, but this can be overridden with the :using option.

Instance Attribute Summary

Attributes inherited from Base

#name, #type

Instance Method Summary collapse

Methods inherited from Base

#cast, #indexed_name, #multiple?, #pair_for, #to_indexed

Constructor Details

#initialize(name, type, options = {}) ⇒ AttributeField

Returns a new instance of AttributeField.



109
110
111
112
# File 'lib/sunspot/field.rb', line 109

def initialize(name, type, options = {})
  @attribute_name = options.delete(:using) || name
  super
end