lib/feedjira.rb
# Parse XML with first compatible parser
#
# @example
#   xml = HTTParty.get("http://example.com").body
#   Feedjira.parse(xml)
Parse XML with first compatible parser
Parse XML with first compatible parser
def parse(xml, parser: nil, &block)
    parser ||= parser_for_xml(xml)
    if parser.nil?
      raise NoParserAvailable, "No valid parser for XML."
    end
    parser.parse(xml, &block)
  end
def parse ( xml , parser : nil , & block ) parser ||= parser_for_xml ( xml ) if parser . nil? raise NoParserAvailable , "No valid parser for XML." end parser . parse ( xml , & block ) end
Parse XML with first compatible parser
Parse XML with first compatible parser
xml
<not_specific>
parser
<not_specific>
block
<not_specific>
example
None