Class: Nimbu::Response::Mashify
- Inherits:
-
Nimbu::Response
- Object
- Faraday::Response::Middleware
- Nimbu::Response
- Nimbu::Response::Mashify
- Defined in:
- lib/nimbu-api/response/mashify.rb
Defined Under Namespace
Classes: Result
Constant Summary
Constants inherited from Nimbu::Response
Instance Method Summary collapse
Methods inherited from Nimbu::Response
define_parser, #parse_response?, #response_type
Instance Method Details
#parse(body) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/nimbu-api/response/mashify.rb', line 13 def parse(body) case body when Hash self.class.parser.call body when Array body.map { |item| item.is_a?(Hash) ? self.class.parser.call(item) : item } else body end end |