Class: Arclight::Traject::NokogiriNamespacelessReader

Inherits:
Traject::NokogiriReader
  • Object
show all
Defined in:
lib/arclight/traject/nokogiri_namespaceless_reader.rb

Overview

Provides a Traject Reader for XML Documents which removes the namespaces

Instance Method Summary collapse

Instance Method Details

#each(*args) ⇒ Object

Overrides the #each method (which is used for iterating through each Document)

Parameters:

  • args

See Also:

  • Traject::NokogiriReader#each
  • Enumerable#each


11
12
13
14
15
16
17
18
19
# File 'lib/arclight/traject/nokogiri_namespaceless_reader.rb', line 11

def each(*args)
  return to_enum(:each, *args) unless block_given?

  super do |doc|
    new_doc = doc.dup
    new_doc.remove_namespaces!
    yield new_doc
  end
end