Sha256: 55a640ac5efd6f4879518d006c6caeb0a92013152a50db870bda192cc25873be
Contents?: true
Size: 524 Bytes
Versions: 10
Compression:
Stored size: 524 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
10 entries across 10 versions & 1 rubygems