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

- (Object) [](key)



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

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

- (Object) []=(key, value)



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

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

- (Object) grep(pattern)



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

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