Class: Spectre::Http::SpectreHttpHeader
- Inherits:
-
Object
- Object
- Spectre::Http::SpectreHttpHeader
- Defined in:
- lib/spectre/http.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(headers) ⇒ SpectreHttpHeader
constructor
A new instance of SpectreHttpHeader.
- #to_s ⇒ Object
Constructor Details
#initialize(headers) ⇒ SpectreHttpHeader
Returns a new instance of SpectreHttpHeader.
173 174 175 |
# File 'lib/spectre/http.rb', line 173 def initialize headers @headers = headers || {} end |
Instance Method Details
#[](key) ⇒ Object
177 178 179 180 181 |
# File 'lib/spectre/http.rb', line 177 def [] key return nil unless @headers.key?(key.downcase) @headers[key.downcase].first end |
#to_s ⇒ Object
183 184 185 |
# File 'lib/spectre/http.rb', line 183 def to_s @headers.to_s end |