class Protocol::HTTP::Header::ETags

def match?(etag)

This implementation is not strictly correct according to the RFC-specified format.
def match?(etag)
	wildcard? || self.include?(etag)
end

def opposite_tag(etag)

def opposite_tag(etag)
	weak_tag?(etag) ? etag[2..-1] : "W/#{etag}"
end

def strong_match?(etag)

Useful with If-Match
def strong_match?(etag)
	wildcard? || (!weak_tag?(etag) && self.include?(etag))
end

def weak_match?(etag)

Useful with If-None-Match
def weak_match?(etag)
	wildcard? || self.include?(etag) || self.include?(opposite_tag(etag))
end

def weak_tag?(tag)

def weak_tag?(tag)
	tag&.start_with? "W/"
end

def wildcard?

def wildcard?
	self.include?("*")
end