class Protocol::HTTP::Header::Connection

The ‘connection` header is used to specify control options such as whether the connection should be kept alive, closed, or upgraded to a different protocol.
Represents the `connection` HTTP header, which controls options for the current connection.

def << value

@parameter value [String] the directive to add.

Adds a directive to the `connection` header. The value will be normalized to lowercase before being added.
def << value
	super(value.downcase)
end

def close?

@returns [Boolean] whether the `close` directive is present, indicating that the connection should be closed after the current request and response.
def close?
	self.include?(CLOSE)
end

def initialize(value = nil)

@parameter value [String | Nil] the raw `connection` header value.

Initializes the connection header with the given value. The value is expected to be a comma-separated string of directives.
def initialize(value = nil)
	super(value&.downcase)
end

def keep_alive?

@returns [Boolean] whether the `keep-alive` directive is present and the connection is not marked for closure with the `close` directive.
def keep_alive?
	self.include?(KEEP_ALIVE) && !close?
end

def upgrade?

@returns [Boolean] whether the `upgrade` directive is present, indicating that the connection should be upgraded to a different protocol.
def upgrade?
	self.include?(UPGRADE)
end