lib/extlib/mash.rb in extlib-0.9.11 vs lib/extlib/mash.rb in extlib-0.9.12

- old
+ new

@@ -110,9 +110,16 @@ # Used to provide the same interface as Hash. # # @return <Mash> This mash unchanged. def stringify_keys!; self end + # @return <Hash> The mash as a Hash with symbolized keys. + def symbolize_keys + h = Hash.new(default) + each { |key, val| h[key.to_sym] = val } + h + end + # @return <Hash> The mash as a Hash with string keys. def to_hash Hash.new(default).merge(self) end