Class: Sunspot::Field::VirtualField

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

Overview

VirtualFields extract data by evaluating the provided block in the context of the model instance.

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 = {}, &block) ⇒ VirtualField

Returns a new instance of VirtualField.



137
138
139
140
# File 'lib/sunspot/field.rb', line 137

def initialize(name, type, options = {}, &block)
  super(name, type, options)
  @block = block
end