Sha256: 5332ec05805731598cf1cd92a1766ad1d5258636ac2ca3027a13a30c192ff8ef

Contents?: true

Size: 472 Bytes

Versions: 10

Compression:

Stored size: 472 Bytes

Contents

module R10K
  module Util
    module CoreExt
      module HashExt
        module SymbolizeKeys
          def symbolize_keys!
            self.keys.each do |key|
              next unless key.is_a? String
              if self[key.to_sym]
                raise TypeError, "An existing interned key for #{key} exists, cannot overwrite"
              end
              self[key.to_sym] = self.delete(key)
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
r10k-1.4.2 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.4.1 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.4.0 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.3.5 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.3.4 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.3.3 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.3.2 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.3.1 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.3.0 lib/r10k/util/core_ext/hash_ext.rb
r10k-1.3.0rc1 lib/r10k/util/core_ext/hash_ext.rb