Sha256: faf4592c2a46260fb956b7db689613f94742fdec01a2e84980e04dbc14fa80f5

Contents?: true

Size: 338 Bytes

Versions: 61

Compression:

Stored size: 338 Bytes

Contents

class Hash
  # Stringify the keys in the hash. Returns a new hash.
  def stringify_keys
    inject({}) do |options, (key, value)|
      options[key.to_s] = value
      options
    end
  end
  # Stringify the keys in the hash in place.
  def stringify_keys!
   keys.each do |key|
     self[key.to_s] = delete(key)
   end
   self
  end
end

Version data entries

61 entries across 61 versions & 8 rubygems

Version Path
ngauthier-hydra-0.24.0 lib/hydra/hash.rb
nulogy-hydra-0.26.0 lib/hydra/hash.rb
arturop-hydra-0.25.0 lib/hydra/hash.rb
arturop-hydra-0.24.0 lib/hydra/hash.rb
hydra-0.24.0 lib/hydra/hash.rb
nulogy-hydra-0.23.2.1 lib/hydra/hash.rb
justinf-hydra-0.23.8 lib/hydra/hash.rb
justinf-hydra-0.23.7 lib/hydra/hash.rb
justinf-hydra-0.23.6 lib/hydra/hash.rb
justinf-hydra-0.23.5 lib/hydra/hash.rb
justinf-hydra-0.23.4 lib/hydra/hash.rb
arturop-hydra-0.23.4 lib/hydra/hash.rb
sskirby-hydra-0.23.3 lib/hydra/hash.rb
hydra-0.23.3 lib/hydra/hash.rb
causes-hydra-0.21.0 lib/hydra/hash.rb
hydra-0.23.2 lib/hydra/hash.rb
hydra-0.23.1 lib/hydra/hash.rb
hydra-0.23.0 lib/hydra/hash.rb
hydra-0.22.2 lib/hydra/hash.rb
hydra-0.22.1 lib/hydra/hash.rb