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-charsetheader value into a list of character sets.
Methods inherited from Split
#<<, coerce, #initialize, parse, #to_s, trailer?
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.
41 42 43 44 45 46 47 48 49 |
# File 'lib/protocol/http/header/accept_charset.rb', line 41 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 |