In Files

Parent

Class/Module Index [+]

Quicksearch

Hash

Public Instance Methods

stringify_keys() click to toggle source

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
stringify_keys!() click to toggle source

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
to_mash() click to toggle source

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.