Mixin for holding meta-information.
Attributes
[RW] | base_uri | returns a |
[R] | meta | returns a |
[R] | metas | returns a |
[RW] | status | returns an |
Instance Public methods
charset() Link
returns a charset parameter in Content-Type field. It is downcased for canonicalization.
If charset parameter is not given but a block is given, the block is called and its result is returned. It can be used to guess charset.
If charset parameter and block is not given, nil is returned except text type. In that case, “utf-8” is returned as defined by RFC6838 4.2.1
content_encoding() Link
Returns a list of encodings in Content-Encoding field as an array of strings.
The encodings are downcased for canonicalization.
# File ruby/lib/open-uri.rb, line 566 def content_encoding vs = @metas['content-encoding'] if vs && %r{\A#{RE_LWS}?#{RE_TOKEN}#{RE_LWS}?(?:,#{RE_LWS}?#{RE_TOKEN}#{RE_LWS}?)*}o =~ (v = vs.join(', ')) v.scan(RE_TOKEN).map {|content_coding| content_coding.downcase} else [] end end
content_type() Link
returns “type/subtype” which is MIME Content-Type. It is downcased for canonicalization. Content-Type parameters are stripped.