Class: TrajectPlus::XmlReader

Inherits:
Object
  • Object
show all
Defined in:
lib/traject_plus/xml_reader.rb

Overview

Reads in XML records for traject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_stream, settings) ⇒ XmlReader

Returns a new instance of XmlReader.

Parameters:

  • input_stream (File)
  • settings (Traject::Indexer::Settings)


8
9
10
11
12
# File 'lib/traject_plus/xml_reader.rb', line 8

def initialize(input_stream, settings)
  @settings = Traject::Indexer::Settings.new settings
  @input_stream = input_stream
  @xml = Nokogiri::XML(input_stream)
end

Instance Attribute Details

#xmlObject (readonly)

Returns the value of attribute xml.



14
15
16
# File 'lib/traject_plus/xml_reader.rb', line 14

def xml
  @xml
end

Instance Method Details

#each {|xml| ... } ⇒ Object

Yields:



16
17
18
# File 'lib/traject_plus/xml_reader.rb', line 16

def each
  yield(xml)
end