Sha256: 50fba0bf9e68cfbcf6ce8bc73e6a71cccff4491617e91f4ecb7623cb30d502b5

Contents?: true

Size: 370 Bytes

Versions: 11

Compression:

Stored size: 370 Bytes

Contents

##
# Case Insensitive Hash
# Designed for HTTP Headers due to RFC 2.6 Chapter 4.2
# https://www.ietf.org/rfc/rfc2616.txt
class HTTPHeader < Hash
  def [](key)
    super _insensitive(key)
  end

  def []=(key, value)
    super _insensitive(key), value
  end

  def key?(key)
    super _insensitive(key)
  end

  protected def _insensitive(key)
    key.downcase
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
midori.rb-0.9.0 lib/midori/core_ext/http_header.rb
midori.rb-0.8.0 lib/midori/core_ext/http_header.rb
midori.rb-0.7.1 lib/midori/core_ext/http_header.rb
midori.rb-0.7.0 lib/midori/core_ext/http_header.rb
midori.rb-0.6.0 lib/midori/core_ext/http_header.rb
midori.rb-0.5.4 lib/midori/core_ext/http_header.rb
midori.rb-0.5.3.1 lib/midori/core_ext/http_header.rb
midori.rb-0.5.3 lib/midori/core_ext/http_header.rb
midori.rb-0.5.2 lib/midori/core_ext/http_header.rb
midori.rb-0.5.1 lib/midori/core_ext/http_header.rb
midori.rb-0.5.0 lib/midori/core_ext/http_header.rb