Class: Github::Response::Mashify
Constant Summary
CONTENT_TYPE
Instance Method Summary
collapse
define_parser, #parse_response?, #response_type
Instance Method Details
#parse(body) ⇒ Object
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/github_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
|