Permalink
Browse files

Documented XMLData

  • Loading branch information...
1 parent e66495c commit 583a9d7d9b0bbf22def2d7ca916150ea9743473a @koraktor committed Apr 30, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/steam/community/xml_data.rb
@@ -1,14 +1,21 @@
# This code is free software; you can redistribute it and/or modify it under
# the terms of the new BSD License.
#
-# Copyright (c) 2011, Sebastian Staudt
+# Copyright (c) 2011-2012, Sebastian Staudt
require 'open-uri'
require 'multi_xml'
+# This class provides basic functionality to parse XML data
+#
+# @author Sebastian Staudt
module XMLData
+ # Parse the given URL as XML data using `multi_xml`
+ #
+ # @param [String] url The URL to parse
+ # @return [Hash<String, Object>] The data parsed from the XML document
def parse(url)
data = open(url, { :proxy => true })
@xml_data = MultiXml.parse(data).values.first

0 comments on commit 583a9d7

Please sign in to comment.