Class: Protocol::HTTP::Header::AcceptCharset
- Defined in:
- lib/protocol/http/header/accept_charset.rb
Overview
The ‘accept-charset` header represents a list of character sets that the client can accept.
Defined Under Namespace
Classes: Charset
Constant Summary collapse
Constants inherited from Split
Instance Method Summary collapse
-
#charsets ⇒ Object
Parse the ‘accept-charset` header value into a list of character sets.
Methods inherited from Split
Constructor Details
This class inherits a constructor from Protocol::HTTP::Header::Split
Instance Method Details
#charsets ⇒ Object
Parse the ‘accept-charset` header value into a list of character sets.
33 34 35 36 37 38 39 40 41 |
# File 'lib/protocol/http/header/accept_charset.rb', line 33 def charsets self.map do |value| if match = value.match(CHARSET) Charset.new(match[:name], match[:q]) else raise ParseError.new("Could not parse character set: #{value.inspect}") end end end |