Class: Rack::Acceptable::Request
- Inherits:
-
Request
- Object
- Request
- Rack::Acceptable::Request
- Includes:
- Headers
- Defined in:
- lib/rack/acceptable/request.rb
Instance Method Summary collapse
Methods included from Headers
Instance Method Details
#accept_content?(content_type) ⇒ Boolean
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rack/acceptable/request.rb', line 18 def accept_content?(content_type) media = MIMETypes.parse_media_range(content_type) chs = media.last.delete(Const::CHARSET) chs ||= Const::ISO_8859_1 if media.first == Const::TEXT if chs accept_media?(media) && accept_charset?(chs) else accept_media?(media) end rescue false end |
#acceptable_charsets ⇒ Object
14 15 16 |
# File 'lib/rack/acceptable/request.rb', line 14 def acceptable_charsets @_acceptable_charsets ||= super end |
#acceptable_media ⇒ Object
10 11 12 |
# File 'lib/rack/acceptable/request.rb', line 10 def acceptable_media @_acceptable_media ||= super end |