class Rack::Headers

def self.[](*items)

Experimental RBS support (using type sampling data from the type_fusion project).

def self.[]: (String key) -> nil

This signature was generated using 2 samples from 2 applications.

def self.[](*items)
  if items.length % 2 != 0
    if items.length == 1 && items.first.is_a?(Hash)
      new.merge!(items.first)
    else
      raise ArgumentError, "odd number of arguments for Rack::Headers"
    end
  else
    hash = new
    loop do
      break if items.length == 0
      key = items.shift
      value = items.shift
      hash[key] = value
    end
    hash
  end
end