Sha256: 24162f714ce868e49f2caea15494eed8147d423d7dfbc8a8e0e69db4329bd802
Contents?: true
Size: 683 Bytes
Versions: 18
Compression:
Stored size: 683 Bytes
Contents
module Grape module ContentTypes # Content types are listed in order of preference. CONTENT_TYPES = { # rubocop:disable Style/MutableConstant xml: 'application/xml', serializable_hash: 'application/json', json: 'application/json', binary: 'application/octet-stream', txt: 'text/plain' } def self.content_types_for_settings(settings) return if settings.blank? settings.each_with_object({}) { |value, result| result.merge!(value) } end def self.content_types_for(from_settings) if from_settings.present? from_settings else Grape::ContentTypes::CONTENT_TYPES end end end end
Version data entries
18 entries across 18 versions & 2 rubygems