Module: SteamCondenser::Community::XMLData

Included in:
GameLeaderboard, SteamGroup, SteamId
Defined in:
lib/steam-condenser/community/xml_data.rb

Overview

This class provides basic functionality to parse XML data

Author:

  • Sebastian Staudt

Instance Method Summary collapse

Instance Method Details

#parse(url) ⇒ Hash<String, Object>

Parse the given URL as XML data using multi_xml

Parameters:

  • url (String)

    The URL to parse

Returns:

  • (Hash<String, Object>)

    The data parsed from the XML document

Raises:

  • (Error)

    if an error occurs while parsing the XML data


22
23
24
25
26
27
# File 'lib/steam-condenser/community/xml_data.rb', line 22

def parse(url)
  data = open(url, { :proxy => true })
  @xml_data = MultiXml.parse(data).values.first
rescue
  raise SteamCondenser::Error.new "XML data could not be parsed: #{$!.message}", $!
end