Class: Mxrb::Http::Headers
- Inherits:
-
Object
- Object
- Mxrb::Http::Headers
- Defined in:
- lib/mxrb/http/server.rb
Overview
Case-insensitive HTTP header collection used by the internal request API.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(values = {}) ⇒ Headers
constructor
A new instance of Headers.
Constructor Details
#initialize(values = {}) ⇒ Headers
Returns a new instance of Headers.
10 11 12 |
# File 'lib/mxrb/http/server.rb', line 10 def initialize(values = {}) @values = values.to_h { |name, value| [name.to_s.downcase, value.to_s] } end |
Instance Method Details
#[](name) ⇒ Object
14 |
# File 'lib/mxrb/http/server.rb', line 14 def [](name) = @values[name.to_s.downcase] |