Sha256: 459ed903bcf511631026f079f4bb058d7d2ab70013a3699ae8e6f4c047a1674d

Contents?: true

Size: 301 Bytes

Versions: 16

Compression:

Stored size: 301 Bytes

Contents

module Webmachine
  # Case-insensitive Hash of request headers
  class Headers < ::Hash
    def [](key)
      super key.to_s.downcase
    end

    def []=(key,value)
      super key.to_s.downcase, value
    end

    def grep(pattern)
      self.class[select { |k,_| pattern === k }]
    end
  end
end

Version data entries

16 entries across 5 versions & 1 rubygems

Version Path
webmachine-0.4.1 pkg/webmachine-0.4.0/pkg/webmachine-0.3.0/pkg/webmachine-0.2.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.1 pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.1 pkg/webmachine-0.2.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.1 pkg/webmachine-0.3.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.1 pkg/webmachine-0.3.0/pkg/webmachine-0.2.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.1 pkg/webmachine-0.4.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.1 pkg/webmachine-0.4.0/pkg/webmachine-0.2.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.1 pkg/webmachine-0.4.0/pkg/webmachine-0.3.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.0 pkg/webmachine-0.3.0/pkg/webmachine-0.2.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.0 pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.0 pkg/webmachine-0.2.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.4.0 pkg/webmachine-0.3.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.3.0 pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.3.0 pkg/webmachine-0.2.0/pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.2.0 pkg/webmachine-0.1.0/lib/webmachine/headers.rb
webmachine-0.1.0 lib/webmachine/headers.rb