Module: Grape::Parser

Defined in:
lib/grape/parser.rb,
lib/grape/parser/xml.rb,
lib/grape/parser/json.rb

Defined Under Namespace

Modules: Json, Xml

Constant Summary collapse

DEFAULTS =
{
  json: Grape::Parser::Json,
  jsonapi: Grape::Parser::Json,
  xml: Grape::Parser::Xml
}.freeze

Class Method Summary collapse

Class Method Details

.parser_for(format, parsers = nil) ⇒ Object



13
14
15
# File 'lib/grape/parser.rb', line 13

def parser_for(format, parsers = nil)
  parsers&.key?(format) ? parsers[format] : DEFAULTS[format]
end