class Hash
Public Instance Methods
stringify_keys()
click to toggle source
Return a copy of the hash with each key converted to a string.
# File lib/aastdlib/hash.rb, line 5 def stringify_keys() stringified = {} self.each {|k,v| stringified[k.to_s] = v} return stringified end
stringify_keys!()
click to toggle source
_Hash is modified inline!_ Converts each key to a string.
# File lib/aastdlib/hash.rb, line 14 def stringify_keys!() stringified = self.stringify_keys() self.clear stringified.each {|k,v| self[k] = v} end