class REXML::Attributes
Public Instance Methods
to_a_hash()
click to toggle source
@return a new hash of the attributes’ name and value pairs.
@example
attributes.to_a_hash => {"src"=>"pic.jpg", "height" => "100", "width" => "200"}
# File lib/sixarm_ruby_rexml/attributes.rb, line 8 def to_a_hash to_a.inject({}){|hash, attribute| hash[attribute.name]=attribute.value; hash} end