Class: String

Inherits:
Object
  • Object
show all
Includes:
TitleCase
Defined in:
lib/droom/searchability.rb

Constant Summary

Constants included from TitleCase

TitleCase::SMALL_WORDS_RE

Instance Method Summary collapse

Methods included from TitleCase

#title_case, #titleize_if_appropriate

Instance Method Details

#flattenObject



17
18
19
# File 'lib/droom/searchability.rb', line 17

def flatten
  split(/[^\w\d\']{1,}/).join(' ')
end

#remove_stopwordsObject



21
22
23
# File 'lib/droom/searchability.rb', line 21

def remove_stopwords
  gsub(STOPWORD_RE, '')
end

#searchableObject



13
14
15
# File 'lib/droom/searchability.rb', line 13

def searchable
  downcase.remove_stopwords.flatten
end