Module: XMLData

Included in:
GameLeaderboard, GameStats, SteamGroup, SteamId
Defined in:
lib/steam/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:



20
21
22
23
24
25
# File 'lib/steam/community/xml_data.rb', line 20

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