Method: Sunspot::AttributeField#initialize
- Defined in:
- lib/sunspot/field.rb
#initialize(name, type, options = {}) ⇒ AttributeField
:nodoc:
125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/sunspot/field.rb', line 125 def initialize(name, type, = {}) super(name, type, ) @multiple = !!.delete(:multiple) @reference = if (reference = .delete(:references)).respond_to?(:name) reference.name elsif reference.respond_to?(:to_sym) reference.to_sym end raise ArgumentError, "Unknown field option #{options.keys.first.inspect} provided for field #{name.inspect}" unless .empty? end |