Method: Traject::NDJReader#each
- Defined in:
- lib/traject/ndj_reader.rb
#each ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/traject/ndj_reader.rb', line 24 def each unless block_given? return enum_for(:each) end @input_stream.each_with_index do |json, i| begin yield MARC::Record.new_from_hash(JSON.parse(json)) rescue Exception => e self.logger.error("Problem with JSON record on line #{i}: #{e.}") end end end |