Sha256: 9dad21c2e4ca01ded78b24db09d58bc4e96ad3c16eb318c5b839c5be64b7fc5b

Contents?: true

Size: 441 Bytes

Versions: 7

Compression:

Stored size: 441 Bytes

Contents

class Mechanize
  class Headers < Hash
    def [](key)
      super(key.downcase)
    end

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

    def key?(key)
      super(key.downcase)
    end

    def canonical_each
      block_given? or return enum_for(__method__)
      each { |key, value|
        key = key.capitalize
        key.gsub!(/-([a-z])/) { "-#{$1.upcase}" }
        yield [key, value]
      }
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
aai10-mechanize-2.0.1.0 lib/mechanize/headers.rb
neocoin-mechanize-2.0.2 lib/mechanize/headers.rb
mechanize-2.0.1 lib/mechanize/headers.rb
mechanize-2.0 lib/mechanize/headers.rb
mechanize-2.0.pre.2 lib/mechanize/headers.rb
mechanize-2.0.pre.1 lib/mechanize/headers.rb
mechanize-1.0.1.beta.20110107104205 lib/mechanize/headers.rb