# File lib/gitlab/cli_helpers.rb, line 161
    def record_hash(data, cmd, args, single_value=false)
      if data.empty?
        result = nil
      else
        arr, keys = get_keys(args, data)
        result = []
        arr.each do |hash|
          row = {}

          keys.each do |key|
            case hash[key]
            when Hash
              row[key] = 'Hash'
            when StringIO
              row[key] = Base64.encode64(hash[key].read)
            when nil
              row[key] = nil
            else
              row[key] = hash[key]
            end
          end

          result.push row
        end
        result = result[0] if single_value && result.count > 0
      end

      {
        cmd: "Gitlab.#{cmd} #{args.join(', ')}".strip,
        result: result
      }
    end