lib/gitlab/cli_helpers.rb
# Convert a hash (recursively) to use symbol hash keys
# @return [Hash]
Convert a hash (recursively) to use symbol hash keys
Convert a hash ( recursively ) to use symbol hash keys
def symbolize_keys(hash)
      if hash.is_a?(Hash)
        hash = hash.each_with_object({}) do |(key, value), newhash|
          begin
            newhash[key.to_sym] = symbolize_keys(value)
          rescue NoMethodError
            puts "error: cannot convert hash key to symbol: #{arg}"
            raise
          end
        end
      end
      hash
    end
def symbolize_keys ( hash ) if hash . is_a? ( Hash ) hash = hash . each_with_object ( { } ) do | ( key , value ) , newhash | begin newhash [ key . to_sym ] = symbolize_keys ( value ) rescue NoMethodError puts "error: cannot convert hash key to symbol: #{arg}" raise end end end hash end
Convert a hash (recursively) to use symbol hash keys
Convert a hash ( recursively ) to use symbol hash keys
None
Hash
hash
<not_specific>