Class: Webmachine::Headers

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

Overview

Case-insensitive Hash of request headers

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



4
5
6
# File 'lib/webmachine/headers.rb', line 4

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

#[]=(key, value) ⇒ Object



8
9
10
# File 'lib/webmachine/headers.rb', line 8

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

#grep(pattern) ⇒ Object



12
13
14
# File 'lib/webmachine/headers.rb', line 12

def grep(pattern)
  select { |k,_| pattern === k }
end