lib/apricoteatsgorilla.rb in smacks-apricoteatsgorilla-0.2.0 vs lib/apricoteatsgorilla.rb in smacks-apricoteatsgorilla-0.2.1
- old
+ new
@@ -4,17 +4,17 @@
# Apricot eats Gorilla translates between XML documents and Ruby hashes.
# It's based on CobraVsMongoose but uses Hpricot instead of REXML to parse
# XML and it also doesn't follow the BadgerFish convention.
#
-# It's initial purpose was to convert SOAP response messages to Ruby hashes,
+# Its initial purpose was to convert SOAP response messages to Ruby hashes,
# but it quickly evolved into a more general translation tool.
class ApricotEatsGorilla
# Converts XML into a Ruby Hash. Starts parsing at root node by default.
# Call with XPath expession (Hpricot search) as second parameter to define
- # a custom root node. The root node itself is not included in the Hash.
+ # a custom root node. The root node itself will not be included in the Hash.
#
# E.g.
# xml = "<dude><likes>beer</likes><hates>appletini</hates></dude>"
# ApricotEatsGorilla.xml_to_hash(xml)
# # => { "hates" => "appletini", "likes" => "beer" }
@@ -97,10 +97,10 @@
else
"<#{name} />"
end
end
- # Helper to remove line breaks and whitespace between XML nodes.
+ # Helper to remove line breaks and whitespace between XML tags.
def self.clean_xml(xml)
xml = xml.gsub(/\n+/, "")
xml = xml.gsub(/(>)\s*(<)/, '\1\2')
end