Class: REXML::Attributes

Inherits:
Object show all
Defined in:
lib/webget_ruby_ramp/xml.rb

Overview

REXML::Attributes extensions

Instance Method Summary collapse

Instance Method Details

#to_hashObject

Returns a new hash of the attribute keys and values.

Examples:

attributes.to_hash => {"src"=>"pic.jpg", "height" => "100", "width" => "200"} 

Returns:

  • a new hash of the attribute keys and values.



160
161
162
163
164
# File 'lib/webget_ruby_ramp/xml.rb', line 160

def to_hash
  h=Hash.new
  self.keys.each{|k| h[k]=self[k]}
  h
end