Sha256: 2ca8d92eeeeb931e91f9342a2597d409d0b5a4ffea083a924a4194bd8e8bb7a8
Contents?: true
Size: 523 Bytes
Versions: 12
Compression:
Stored size: 523 Bytes
Contents
require 'action_dispatch' module Acfs class Response # Quick accessors for format handling. module Formats def content_type @content_type ||= read_content_type end def json? content_type == Mime::JSON end private def read_content_type return 'text/plain' unless headers && headers['Content-Type'] content_type = headers['Content-Type'].split(/;\s*\w+="?\w+"?/).first Mime::Type.parse(content_type).first end end end end
Version data entries
12 entries across 12 versions & 1 rubygems