Object
Returns a duplicate of the current hash with all of the keys converted to strings.
# File lib/mash.rb, line 212 def stringify_keys dup.stringify_keys! end
Converts all of the keys to strings
# File lib/mash.rb, line 217 def stringify_keys! keys.each{|k| v = delete(k) self[k.to_s] = v v.stringify_keys! if v.is_a?(Hash) v.each{|p| p.stringify_keys! if p.is_a?(Hash)} if v.is_a?(Array) } self end
Returns a new Mash initialized from this Hash.
# File lib/mash.rb, line 204 def to_mash mash = Mash.new(self) mash.default = default mash end
[Validate]
Generated with the Darkfish Rdoc Generator 2.