Class: Sunspot::JoinField

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

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Field

#boost, #indexed_name, #name, #reference, #type

Instance Method Summary collapse

Methods inherited from Field

#cast, #eql?, #hash, #more_like_this?, #multiple?, #to_indexed

Constructor Details

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

Returns a new instance of JoinField.

Raises:

  • (ArgumentError)


164
165
166
167
168
169
# File 'lib/sunspot/field.rb', line 164

def initialize(name, type, options = {})
  @multiple = !!options.delete(:multiple)
  super(name, type, options)
  @join_string = options.delete(:join_string)
  raise ArgumentError, "Unknown field option #{options.keys.first.inspect} provided for field #{name.inspect}" unless options.empty?
end

Instance Method Details

#local_paramsObject



171
172
173
# File 'lib/sunspot/field.rb', line 171

def local_params
  "{!join #{@join_string}}"
end