class TeRex::Format::ErrorFile

Attributes

category[R]
path[R]
sentences[R]

Public Class Methods

new(file_path, klass) click to toggle source
# File lib/format/error_file.rb, line 10
def initialize(file_path, klass)
  @path = file_path
  @category = klass
end

Public Instance Methods

scanner() click to toggle source

Each row of csv as Array object, strip it and return

# File lib/format/error_file.rb, line 16
def scanner
  accumulator = []
  CSV.foreach(@path, @@csv_conf) do |row|
    next if row.empty?
    stripped_line = row[0].strip
    unless stripped_line.nil? || stripped_line.empty?
      accumulator << stripped_line
    end
  end
  @sentences ||= accumulator
end