Sha256: abfa532571dd3ae795d15745b5782c2756d5179ff540fb39e03961b280e775a7

Contents?: true

Size: 394 Bytes

Versions: 31

Compression:

Stored size: 394 Bytes

Contents

class Mechanize::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

Version data entries

31 entries across 31 versions & 5 rubygems

Version Path
mechanize-2.7.7 lib/mechanize/headers.rb
husc-0.2.1 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/headers.rb
husc-0.2.0 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/headers.rb
husc-0.1.1 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/headers.rb
husc-0.1.0 vendor/bundle/gems/mechanize-2.7.6/lib/mechanize/headers.rb
mechanize-2.7.6 lib/mechanize/headers.rb
mechanize-2.7.5 lib/mechanize/headers.rb
mechanize-2.7.4 lib/mechanize/headers.rb
mechanize-2.7.3 lib/mechanize/headers.rb
mechanize-2.7.2 lib/mechanize/headers.rb
mechanize-2.7.1 lib/mechanize/headers.rb
mechanize-2.7.0 lib/mechanize/headers.rb
mechanize-2.6.0 lib/mechanize/headers.rb
mechanize-2.5.1 lib/mechanize/headers.rb
mechanize-2.5 lib/mechanize/headers.rb
mechanize-2.4 lib/mechanize/headers.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/headers.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/headers.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/headers.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/headers.rb