Class: Mechanize::Headers

Inherits:
Hash
  • Object
show all
Defined in:
lib/mechanize/headers.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



2
3
4
# File 'lib/mechanize/headers.rb', line 2

def [](key)
  super(key.downcase)
end

#[]=(key, value) ⇒ Object



6
7
8
# File 'lib/mechanize/headers.rb', line 6

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

#canonical_eachObject



14
15
16
17
18
19
20
21
# File 'lib/mechanize/headers.rb', line 14

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

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/mechanize/headers.rb', line 10

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