Class: Datanorm::Documents::Preprocess

Inherits:
Object
  • Object
show all
Includes:
Calls, Logging
Defined in:
lib/datanorm/documents/preprocess.rb

Overview

Takes an entire Datanorm file and writes many small text files from it so that the content can later be iterated over in an efficient way.

Instance Method Summary collapse

Methods included from Logging

included

Instance Method Details

#callObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/datanorm/documents/preprocess.rb', line 15

def call
  FileUtils.mkdir_p(workdir)

  file.each do |record|
    ::Datanorm::Documents::Preprocesses::Process.call(workdir:, record:)

    progress.increment!
    if yield_progress
      yield nil, progress # No items to yield during preprocess.
    end
  end
end