Module: Grape::Parser
- Extended by:
- ActiveSupport::Autoload, Util::Registrable
- Defined in:
- lib/grape.rb,
lib/grape/parser.rb,
lib/grape/parser/xml.rb,
lib/grape/parser/json.rb
Defined Under Namespace
Modules: Json, Xml
Class Method Summary
collapse
default_elements, register
Class Method Details
.builtin_parsers ⇒ Object
.parser_for(api_format, **options) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/grape/parser.rb', line 20
def parser_for(api_format, **options)
spec = parsers(**options)[api_format]
case spec
when nil
nil
when Symbol
method(spec)
else
spec
end
end
|
.parsers(**options) ⇒ Object
16
17
18
|
# File 'lib/grape/parser.rb', line 16
def parsers(**options)
builtin_parsers.merge(default_elements).merge!(options[:parsers] || {})
end
|