Class: Protocol::HTTP::Header::Date

Inherits:
String
  • Object
show all
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.

Instance Method Summary collapse

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_timeObject

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