class Protocol::HTTP::Header::Split
This isn’t a specific header class is a utility for handling headers with comma-separated values, such as ‘accept`, `cache-control`, and other similar headers. The values are split and stored as an array internally, and serialized back to a comma-separated string when needed.
Represents headers that can contain multiple distinct values separated by commas.
def << value
The input string is split into distinct entries and appended to the array.
Adds one or more comma-separated values to the header.
def << value self.push(*value.split(COMMA)) end
def initialize(value = nil)
Initializes a `Split` header with the given value. If the value is provided, it is split into distinct entries and stored as an array.
def initialize(value = nil) if value super(value.split(COMMA)) else super() end end
def to_s
Serializes the stored values into a comma-separated string.
def to_s join(",") end