Module: Awesome::Definitions::Stopwords::ClassMethods

Defined in:
lib/awesome/definitions/stopwords.rb

Instance Method Summary collapse

Instance Method Details

#stopwords(key = :none) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/awesome/definitions/stopwords.rb', line 20

def stopwords(key = :none)
  case key
    when :none then
      self.search_stopwords[:none]
    when :standard then
      self.search_stopwords[:standard]
    when :custom then
      self.search_stopwords[:custom]
    when :both then
      self.search_stopwords[:custom] | self.search_stopwords[:standard]
    else
      Rails.logger.warn("AwesomeSearch: Stopwords Key Invalid, defaulting to :both")
      self.search_stopwords[:custom] | self.search_stopwords[:standard]
  end
end