Class: Sunspot::Field::AttributeField
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
Instance Method Summary collapse
-
#initialize(name, type, options = {}) ⇒ AttributeField
constructor
A new instance of AttributeField.
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, = {}) @attribute_name = .delete(:using) || name super end |