Module: Grape::ContentTypes
Constant Summary
collapse
- CONTENT_TYPES =
Content types are listed in order of preference.
{
xml: 'application/xml',
serializable_hash: 'application/json',
json: 'application/json',
binary: 'application/octet-stream',
txt: 'text/plain'
}.freeze
Class Method Summary
collapse
default_elements, register
Class Method Details
.content_types_for(from_settings) ⇒ Object
21
22
23
|
# File 'lib/grape/content_types.rb', line 21
def content_types_for(from_settings)
from_settings.presence || Grape::ContentTypes::CONTENT_TYPES.merge(default_elements)
end
|
.content_types_for_settings(settings) ⇒ Object
17
18
19
|
# File 'lib/grape/content_types.rb', line 17
def content_types_for_settings(settings)
settings&.inject(:merge!)
end
|