Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/imp3/cli.rb

Instance Method Summary collapse

Instance Method Details

#normalizeObject



92
93
94
# File 'lib/imp3/cli.rb', line 92

def normalize
  FriendlyId::SlugString.new(self).normalize!.approximate_ascii!.to_s
end

#normalized_without_wordsObject



88
89
90
# File 'lib/imp3/cli.rb', line 88

def normalized_without_words
  self.strip_meaningless_words.normalize
end

#strip_meaningless_wordsObject



80
81
82
83
84
85
86
# File 'lib/imp3/cli.rb', line 80

def strip_meaningless_words
  string = self
  IMP3::Config.instance.strip_words.each do |w|
    string = string.gsub(/\b#{w}\b/i, '')
  end
  string.strip
end