Class: Protocol::HTTP::Header::Date
- Inherits:
-
String
- Object
- String
- Protocol::HTTP::Header::Date
- Defined in:
- lib/protocol/http/header/date.rb
Overview
The ‘date` header represents the date and time at which the message was originated.
This header is typically included in HTTP responses and follows the format defined in RFC 9110.
Class Method Summary collapse
-
.trailer? ⇒ Boolean
Whether this header is acceptable in HTTP trailers.
Instance Method Summary collapse
-
#<<(value) ⇒ Object
Replaces the current value of the ‘date` header with the specified value.
-
#to_time ⇒ Object
Converts the ‘date` header value to a `Time` object.
Class Method Details
.trailer? ⇒ Boolean
Whether this header is acceptable in HTTP trailers. Date headers can safely appear in trailers as they provide metadata about response generation.
32 33 34 |
# File 'lib/protocol/http/header/date.rb', line 32 def self.trailer? true end |
Instance Method Details
#<<(value) ⇒ Object
Replaces the current value of the ‘date` header with the specified value.
18 19 20 |
# File 'lib/protocol/http/header/date.rb', line 18 def << value replace(value) end |
#to_time ⇒ Object
Converts the ‘date` header value to a `Time` object.
25 26 27 |
# File 'lib/protocol/http/header/date.rb', line 25 def to_time ::Time.parse(self) end |