Class: Oembed::XmlParser

Inherits:
Object
  • Object
show all
Defined in:
lib/oembed/xml_parser.rb

Class Method Summary collapse

Class Method Details

.parse(source) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/oembed/xml_parser.rb', line 7

def self.parse(source)
  begin
    document = REXML::Document.new(source)
    traverse(document.root)
  rescue REXML::ParseException => e
    raise Oembed::ParserError.new(e), 'XML parser error'
  end
end