Class: XMLElementExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/upload/xml_element_extractor.rb

Class Method Summary collapse

Class Method Details

.extract(element, xml_string) ⇒ Object



4
5
6
7
8
9
# File 'lib/upload/xml_element_extractor.rb', line 4

def self.extract element, xml_string
  doc = REXML::Document.new xml_string
  return doc.elements.each(element) do |found|
    return found.text
  end
end