class Assembla::Response::Mashify

Public Instance Methods

parse(body) click to toggle source
# File lib/assembla_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