Class: Sunspot::Query::Spellcheck

Inherits:
Connective::Conjunction show all
Defined in:
lib/sunspot/query/spellcheck.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Connective::Conjunction

#add_conjunction, inverse

Methods inherited from Connective::Abstract

#add_component, #add_conjunction, #add_disjunction, #add_negated_restriction, #add_negated_shorthand_restriction, #add_positive_restriction, #add_positive_shorthand_restriction, #add_restriction, #add_shorthand_restriction, #negate, #negated?, #to_boolean_phrase

Methods included from Filter

#tag, #to_filter_query

Constructor Details

#initialize(options = {}) ⇒ Spellcheck

Returns a new instance of Spellcheck.



6
7
8
# File 'lib/sunspot/query/spellcheck.rb', line 6

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/sunspot/query/spellcheck.rb', line 4

def options
  @options
end

Instance Method Details

#to_paramsObject



10
11
12
13
14
15
16
# File 'lib/sunspot/query/spellcheck.rb', line 10

def to_params
  options = {}
  @options.each do |key, val|
    options["spellcheck." + Sunspot::Util.method_case(key.to_s)] = val
  end
  { :spellcheck => true }.merge(options)
end