Class: TypoChecker::TyposLoader
- Inherits:
-
Object
- Object
- TypoChecker::TyposLoader
- Defined in:
- lib/typo_checker/typos_loader.rb
Instance Method Summary collapse
-
#initialize(skips) ⇒ TyposLoader
constructor
A new instance of TyposLoader.
- #load_typos(file_path) ⇒ Object
Constructor Details
#initialize(skips) ⇒ TyposLoader
Returns a new instance of TyposLoader.
5 6 7 |
# File 'lib/typo_checker/typos_loader.rb', line 5 def initialize(skips) @skips = skips end |
Instance Method Details
#load_typos(file_path) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/typo_checker/typos_loader.rb', line 9 def load_typos(file_path) typos = {} CSV.foreach(file_path, headers: false) do |row| next if @skips.include?(row[0]) typos[row[0]] = row[1] end typos end |