class ExternalMigration::SpellingFix

Public Class Methods

new(url) click to toggle source
# File lib/external_migration/spelling_fix.rb, line 5
def initialize(url)
  @rules = YAML::load(File.open(url))
end

Public Instance Methods

fix!(term) click to toggle source
# File lib/external_migration/spelling_fix.rb, line 9
def fix!(term)
  return term if term.nil? || term.empty?
  @rules.each do |before,after|
    term.gsub! before, after
  end
  
  term
end