Class: ApiBlueprint::Parser
- Defined in:
- lib/api-blueprint/parser.rb
Instance Method Summary collapse
-
#parse(body) ⇒ Object
Nothing special here.
Methods inherited from Struct
Instance Method Details
#parse(body) ⇒ Object
Nothing special here. Write a class which overrides #parse to make a custom parser.
6 7 8 9 10 |
# File 'lib/api-blueprint/parser.rb', line 6 def parse(body) body.is_a?(String) ? JSON.parse(body) : body rescue JSON::ParserError {} end |