Module: Net::HTTPHeader
- Defined in:
- lib/ruuuby/protocol/http_request.rb
Instance Attribute Summary collapse
-
#cached_headers ⇒ Object
readonly
Returns the value of attribute cached_headers.
Instance Method Summary collapse
- #cache_warmup ⇒ Hash
-
#∃ᴴ?(header_name) ⇒ Boolean
expected values for argheader_name | value | | ————– | | server | | date | | content-type | | content-length | | connection |.
Instance Attribute Details
#cached_headers ⇒ Object (readonly)
Returns the value of attribute cached_headers.
16 17 18 |
# File 'lib/ruuuby/protocol/http_request.rb', line 16 def cached_headers @cached_headers end |
Instance Method Details
#cache_warmup ⇒ Hash
19 20 21 22 |
# File 'lib/ruuuby/protocol/http_request.rb', line 19 def cache_warmup @cached_headers = self.∀ᴴ.to_h if @cached_headers.nil? @cached_headers end |
#∃ᴴ?(header_name) ⇒ Boolean
expected values for argheader_name
| value |
| -------------- |
| server |
| date |
| content-type |
| content-length |
| connection |
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/ruuuby/protocol/http_request.rb', line 36 def ∃ᴴ?(header_name) 🛑str❓('header_name', header_name) self.cache_warmup if @cached_headers.∅? 🛑 ::RuntimeError.new("| f{∃ᴴ?} called when the response object does not have any headers, val-self{#{self.to_s}}|") else self.∀🔑 do |header| return true if header == header_name end false end end |